WD: small fixes and favorite api added.

update_flutter_3.24_vida_plus_episode_MDS
taha.alam 1 year ago
parent f7ed4b6c68
commit 772ab2504b

@ -363,6 +363,10 @@ const REMOVE_CURRENT_MEDICATION = 'Services/DoctorApplication.svc/REST/DeleteHom
const ADD_CURRENT_MEDICATION = 'Services/DoctorApplication.svc/REST/AddHomeMedication';
const CREATE_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PostProgressNote';
const GET_PATIENT_CLINIC = 'Services/DoctorApplication.svc/REST/GetPatientConditionProgress';
var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************

@ -1226,5 +1226,9 @@ const Map<String, Map<String, String>> localizedValues = {
},
"activate": {"en": "Activate", "ar":"فعل"},
"resolved": {"en": "Resolved", "ar":"تم الحل"},
"diagnosisAlreadyDeleted": {"en": "Diagnosis Already Deleted", "ar":"تم حذف التشخيص بالفعل"},
"diagnosisAlreadyResolved": {"en": "Diagnosis Already Resolved", "ar":"تم حل التشخيص بالفعل"},
"selectReaction": {"en": "Select Reaction", "ar":"حدد رد الفعل"},
"progressNoteCanNotBeEmpty": {"en": "Progress Note Can Not Be Empty", "ar":"ملاحظة التقدم لا يمكن أن تكون فارغة"},
};

@ -111,14 +111,14 @@ class PatientPreviousDiagnosis {
Map<String, dynamic> toJson() {
return {
'active': active,
'admissionId': admissionId,
'admissionRequestId': admissionRequestId,
'admissionId': admissionId ?? 0,
'admissionRequestId': admissionRequestId ?? 0,
'appointmentId': appointmentId,
'approvedBy': approvedBy,
'approvedOn': approvedOn,
'assessmentId': assessmentId,
'chiefComplainId': chiefComplainId,
'clinicGroupId': clinicGroupId,
'assessmentId': assessmentId ?? 0,
'chiefComplainId': chiefComplainId ?? 0,
'clinicGroupId': clinicGroupId ?? 0,
'clinicId': clinicId,
'condition': condition,
'createdBy': createdBy,
@ -129,7 +129,7 @@ class PatientPreviousDiagnosis {
'deletedRemarks': deletedRemarks,
'diagnosisType': diagnosisType,
'doctorId': doctorId,
'episodeId': episodeId,
'episodeId': episodeId ?? 0,
'hospitalGroupId': hospitalGroupId,
'hospitalId': hospitalId,
'icdCodeDetailsDto': icdCodeDetailsDto,

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

@ -0,0 +1,11 @@
class PatientCondition{
String? code;
int? id;
String? name;
PatientCondition.fromJson(Map<dynamic, dynamic> json){
name = json['name'] ?? '';
id = json['id'] ?? -1;
code = json['code'] ?? '';
}
}

@ -39,6 +39,7 @@ import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/get_physical_ex
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/PatientCondition.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/progress_note.dart';
@ -80,7 +81,8 @@ class SOAPService extends LookupService {
List<SearchDiagnosis> searchDiagnosisList = [];
List<PatientPhysicalExamination> patientPhysicalExaminationList = [];
List<GeneralSpeciality> generalSpeciality = [];
List<Clinic> clinicsList = [];
List<SOAPClinic> clinicsList = [];
List<PatientCondition> patientConditionList = [];
Map<String, List<Category>> specialityDetails = {};
Map<String, dynamic> diagnosisTypeList = {};
Map<String, dynamic> conditionTypeList = {};
@ -447,6 +449,7 @@ class SOAPService extends LookupService {
searchAllergiesList.add(AllergiesListVidaPlus.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
searchAllergiesList.clear();
hasError = true;
super.error = error;
}, body: {
@ -610,13 +613,16 @@ class SOAPService extends LookupService {
..addAll(request)
..addAll(req);
hasError = false;
bool success = false;
await baseAppClient.post(CREATE_HOPI,
onSuccess: (dynamic response, int statusCode) {
DrAppToastMsg.showSuccesToast("History Saved Successfully");
success = true;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: finalRequest);
return success;
}
getHopi(PatiantInformtion patient) async {
@ -706,7 +712,7 @@ class SOAPService extends LookupService {
"diseaseCode": diagnosis,
};
hasError = false;
searchDiagnosisList.clear();
clearSearchResult();
await baseAppClient.post(SEARCH_DIAGNOSIS,
onSuccess: (dynamic response, int statusCode) {
@ -714,12 +720,17 @@ class SOAPService extends LookupService {
.forEach((v) => searchDiagnosisList.add(SearchDiagnosis.fromJson(v)));
_processData();
}, onFailure: (String error, int statusCode) {
searchChiefComplaintListVidaPlus.clear();
clearSearchResult();
hasError = true;
super.error = error;
}, body: request);
}
clearSearchResult(){
searchDiagnosisList.clear();
icdVersionList.clear();
}
void _processData() {
Set<String> icdVersions = {};
for (var item in searchDiagnosisList) {
@ -797,21 +808,21 @@ class SOAPService extends LookupService {
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,
"HospitalGroupID": await sharedPref.getString(DOCTOR_SETUP_ID), //setup
"hospitalId": patient.projectId,
"patientId": patient.patientId,
"patientPomrId": patient.pomrId,
"startRow": 0,
"endRow": 2,
"ProjectID": 313
"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();
@ -829,21 +840,21 @@ class SOAPService extends LookupService {
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,
// "hospitalGroupId": 105,
// "hospitalId": 313,
// "patientId": 70023498,
// "patientPomrId": 9907,
// "startRow": 0,
// "endRow": 1000000,
// "ProjectID": patient.projectId
// "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,
@ -861,31 +872,33 @@ class SOAPService extends LookupService {
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,
// "setupId": await sharedPref.getString(DOCTOR_SETUP_ID)
"patientProblemId": patientProblemId,
"patientId": patientInfo.patientId,
"problemId": problemId,
"deletedRemarks": deletedRemarks,
"ProjectID": patientInfo.projectId,
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID)
//todo just for the test as the create diagnosis is still not working
"patientProblemId": 13691,
"patientId": 70010986,
"problemId": 41698,
"deletedRemarks": "kethees test",
"ProjectID": 313,
"setupId": 105
// "patientProblemId": 13691,
// "patientId": 70010986,
// "problemId": 41698,
// "deletedRemarks": "kethees test",
// "ProjectID": 313,
// "setupId": 105
};
hasError = false;
var success = 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
success = true;
}, onFailure: (String error, int statusCode) {
patientPreviousDiagnosisList.clear();
hasError = true;
super.error = error;
}, body: request);
return success;
}
favoriteDiagnosis(
@ -1011,7 +1024,6 @@ class SOAPService extends LookupService {
};
hasError = false;
var isFavoriteAdded = false;
favoriteDiagnosisDetailsList.clear();
await baseAppClient.post(ADD_TO_FAVORITE_DIAGNOSIS,
onSuccess: (dynamic response, int statusCode) {
var result = response['ListDiagnosisAddFavourite']['resultData'];
@ -1024,7 +1036,6 @@ class SOAPService extends LookupService {
response['ListDiagnosisAddFavourite']['message']);
}
}, onFailure: (String error, int statusCode) {
favoriteDiagnosisDetailsList.clear();
hasError = true;
isFavoriteAdded = false;
super.error = error;
@ -1033,7 +1044,7 @@ class SOAPService extends LookupService {
return isFavoriteAdded;
}
convertPreviousDiagnosisCurrent(PatiantInformtion paitientInfo,
Future<bool> convertPreviousDiagnosisCurrent(PatiantInformtion paitientInfo,
PatientPreviousDiagnosis diagnosis) async {
Map<String, dynamic> request = {
"patientProblemRevisionId": diagnosis.patientProblemRevisionId,
@ -1050,18 +1061,21 @@ class SOAPService extends LookupService {
"ProjectID": paitientInfo.projectId
};
hasError = false;
var addedToFavorite = false;
var success = false;
await baseAppClient.post(MAKE_PREVIOUS_AS_CURRENT_DIAGNOSIS,
onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) async {
var result = response['ContinuePreviousEpisode']['resultData'];
if ((result as List).isEmpty) {
DrAppToastMsg.showErrorToast(
response['ContinuePreviousEpisode']['message']);
} else {
success = true;
}
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: request);
return success;
}
Future getProgressNoteNew(PatiantInformtion patientInformation) async {
@ -1170,6 +1184,88 @@ class SOAPService extends LookupService {
return success;
}
Future<bool> createDiagnosisFromFavorite(
PatiantInformtion patient,
FavoriteDiseaseDetails? 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.diseases,
"diseasesCode": searchDiagnosis.diseasesCode,
"diseasesId": searchDiagnosis.diseasesId,
"selectedIcdCode": searchDiagnosis.icdId,
"selectedCategoryCode": searchDiagnosis.categoryCode,
"selectedSectionCode": searchDiagnosis.sectionCode,
"selectedChapterCode": searchDiagnosis.chapterCode,
// "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> createProgressNote(PatiantInformtion patient, String? clinicID,
String conditionType, String note, ) async {
Map<String, dynamic> request = {
"planNote": note,
"PatientMRN": patient.patientMRN,
"EpisodeID": patient.episodeNo,
"CreatedByName": patient.doctorName,
"CreatedBy": patient.doctorId,
"Speciality": clinicID,
"ProgressNotesTypes": "DOCTOR_NOTE",
"PatientCondition": conditionType,
"ProjectID": patient.projectId
};
var success = false;
await baseAppClient.post(CREATE_PROGRESS_NOTE,
onSuccess: (dynamic response, int statusCode) {
if (response['ListCreateProgressNote'] != null) {
DrAppToastMsg.showSuccesToast(
response['ListCreateProgressNote']['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;
@ -1228,8 +1324,25 @@ class SOAPService extends LookupService {
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))));
response['ListDoctorClinics']
.forEach((v) => clinicsList.add(SOAPClinic.fromJson(v)));
success = false;
}, onFailure: (String error, int statusCode) {
success = false;
hasError = true;
super.error = error;
}, body: request);
return success;
}
Future<bool> getPatientCondition() async {
Map<String, dynamic> request = {};
var success = false;
await baseAppClient.post(GET_PATIENT_CLINIC,
onSuccess: (dynamic response, int statusCode) {
response['ListPatientConditionProgress']['resultData'].forEach((v) => v['PATIENT_CONDITION'].forEach(
(item) => patientConditionList.add(PatientCondition.fromJson(item))));
success = false;
}, onFailure: (String error, int statusCode) {
success = false;

@ -36,6 +36,7 @@ import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/post_physical_e
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/PatientCondition.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/progress_note.dart';
@ -148,10 +149,9 @@ class SOAPViewModel extends BaseViewModel {
List<GetChiefComplaintVidaPlus> get getChiefComplaintListVidaPlus =>
_SOAPService.patientChiefComplaintListVidaPlus;
List<EpisodeByChiefComplaintVidaPlus> get episodeByChiefComplaintListVidaPlus =>
_SOAPService.episodeByChiefComplaintListVidaPlus;
List<EpisodeByChiefComplaintVidaPlus>
get episodeByChiefComplaintListVidaPlus =>
_SOAPService.episodeByChiefComplaintListVidaPlus;
List<PatientPhysicalExamination> get patientPhysicalExaminationList =>
_SOAPService.patientPhysicalExaminationList;
@ -159,20 +159,22 @@ class SOAPViewModel extends BaseViewModel {
List<AuditDiagnosis> get auditDiagnosislist =>
_SOAPService.auditDiagnosislist;
List<PatientCondition> get patientConditionList =>
_SOAPService.patientConditionList;
List<GeneralSpeciality>? mainSpecialityList = null;
List<GeneralSpeciality> speciality = [];
List<ProgressNote> get progressNote =>
_SOAPService.patientProgressNoteListVidaPlus;
List<Clinic> get clinics =>
_SOAPService.clinicsList;
List<SOAPClinic> get clinics => _SOAPService.clinicsList;
Map<String, List<Category>> get specialityDetails =>
_SOAPService.specialityDetails;
int? get episodeID => _SOAPService.episodeID;
bool get showAudit => _SOAPService.showAuditBottomSheet;
bool get isPrescriptionOrder => _SOAPService.isPrescriptionOrder;
@ -195,18 +197,15 @@ class SOAPViewModel extends BaseViewModel {
List<GetMedicationResponseModel>? get allMedicationList =>
_prescriptionService.allMedicationList;
List<GetHomeMedicationList>? get getHomeMedicationList =>
_SOAPService.getHomeMedicationList;
List<GetSearchCurrentMedication>? get getMedicationListVP =>
_SOAPService.getSearchCurrentMedication;
List<GetSearchCurrentMedicationDetails>? get getSearchCurrentMedicationDetails =>
_SOAPService.getSearchCurrentMedicationDetails;
List<GetSearchCurrentMedicationDetails>?
get getSearchCurrentMedicationDetails =>
_SOAPService.getSearchCurrentMedicationDetails;
late SubjectiveCallBack subjectiveCallBack;
@ -997,7 +996,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
getEditAllergiesVidaPlus(int AllergyID ) async {
getEditAllergiesVidaPlus(int AllergyID) async {
setState(ViewState.BusyLocal);
await _SOAPService.getEditAllergies(AllergyID);
if (_SOAPService.hasError) {
@ -1039,7 +1038,6 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
updateAllergies(
PatientAllergiesVidaPlus request, PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal);
@ -1051,14 +1049,17 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
saveHopi(Map<String, dynamic> req, PatiantInformtion patientInfo) async {
Future<bool> saveHopi(
Map<String, dynamic> req, PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal);
await _SOAPService.saveHopi(req, patientInfo);
bool result = await _SOAPService.saveHopi(req, patientInfo);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
return result;
}
getHopi(PatiantInformtion patientInfo) async {
@ -1100,7 +1101,9 @@ class SOAPViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
updateChiefComplaint(PatiantInformtion patientInfo, GetChiefComplaintVidaPlus CC) async {
updateChiefComplaint(
PatiantInformtion patientInfo, GetChiefComplaintVidaPlus CC) async {
setState(ViewState.BusyLocal);
await _SOAPService.updateChiefComplaintVidaPlus(patientInfo, CC);
if (_SOAPService.hasError) {
@ -1109,6 +1112,7 @@ class SOAPViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
episodeByChiefComplaint(PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal);
await _SOAPService.episodeByChiefComplaint(patientInfo);
@ -1118,7 +1122,9 @@ class SOAPViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
createCCByEpisode(PatiantInformtion patientInfo, List<PatientPomrs> chiefComplaint) async {
createCCByEpisode(
PatiantInformtion patientInfo, List<PatientPomrs> chiefComplaint) async {
setState(ViewState.BusyLocal);
await _SOAPService.continueEpisodeVidaPlus(patientInfo, chiefComplaint);
if (_SOAPService.hasError) {
@ -1127,6 +1133,7 @@ class SOAPViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
getHomeMedication(PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal);
await _SOAPService.getHomeMedication(patientInfo);
@ -1137,7 +1144,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
searchCurrentMedication(String searchQuery) async{
searchCurrentMedication(String searchQuery) async {
setState(ViewState.BusyLocal);
await _SOAPService.searchCurrentMedication(searchQuery);
if (_SOAPService.hasError) {
@ -1147,7 +1154,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
getCurrentMedicationDetails(String id) async{
getCurrentMedicationDetails(String id) async {
setState(ViewState.BusyLocal);
await _SOAPService.getCurrentMedicationDetails(id);
if (_SOAPService.hasError) {
@ -1157,7 +1164,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
removeCurrentMedication(String id) async{
removeCurrentMedication(String id) async {
setState(ViewState.BusyLocal);
await _SOAPService.removeCurrentMedicationVidaPlus(id);
if (_SOAPService.hasError) {
@ -1167,7 +1174,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
addCurrentMedication(request, PatiantInformtion patientInfo) async{
addCurrentMedication(request, PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal);
await _SOAPService.addCurrentMedicationVidaPlus(request, patientInfo);
if (_SOAPService.hasError) {
@ -1178,7 +1185,6 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
searchDiagnosis(PatiantInformtion patientInfo, String searchQuery) async {
setState(ViewState.BusyLocal);
await _SOAPService.searchDiagnosis(patientInfo, searchQuery);
@ -1189,7 +1195,13 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
clearSearchResult() {
_SOAPService.clearSearchResult();
notifyListeners();
}
getConditionAndType(PatiantInformtion patientInfo) async {
clearSearchResult();
setState(ViewState.BusyLocal);
await _SOAPService.getDiagnosisType(patientInfo);
await _SOAPService.getConditionType(patientInfo);
@ -1250,14 +1262,19 @@ class SOAPViewModel extends BaseViewModel {
}
void removeDiagnosis(
PatiantInformtion patientInfo, {
String? patientProblemId,
String? problemId,
String? deletedRemarks,
}) async {
PatiantInformtion patientInfo,
PatientPreviousDiagnosis currentDiagnosisItem,
String remarks,
) async {
setState(ViewState.BusyLocal);
await _SOAPService.removeDiagnosis(
patientInfo, patientProblemId, problemId, deletedRemarks);
var result = await _SOAPService.removeDiagnosis(
patientInfo,
currentDiagnosisItem.patientProblemId?.toString(),
currentDiagnosisItem.problemId?.toString(),
remarks);
if (result) {
await getCurrentDiagnosisList(patientInfo);
}
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
@ -1286,14 +1303,11 @@ class SOAPViewModel extends BaseViewModel {
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);
bool result = await _SOAPService.addToFavoriteDiagnosis(patientInfo,
profile?['DoctorName'] ?? '', diagnosis?.diseasesBCode ?? '', userID);
// if (diagnosis != null) {
diagnosis?.isFavorite = result;
diagnosis?.isFavorite = result;
// searchDiagnosisList[index] = diagnosis;
// }
@ -1308,7 +1322,9 @@ class SOAPViewModel extends BaseViewModel {
void convertPreviousDiagnosisCurrent(PatiantInformtion paitientInfo,
PatientPreviousDiagnosis diagnosis) async {
setState(ViewState.BusyLocal);
await _SOAPService.convertPreviousDiagnosisCurrent(paitientInfo, diagnosis);
var result = await _SOAPService.convertPreviousDiagnosisCurrent(
paitientInfo, diagnosis);
if (result) await getPreviousPatientDetails(paitientInfo);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
@ -1374,7 +1390,6 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
void toggleShowBottomSheetValue(bool status) {
_SOAPService.showAuditBottomSheet = status;
}
@ -1408,6 +1423,43 @@ class SOAPViewModel extends BaseViewModel {
return result;
}
Future<bool> createDiagnosisFromFavorite(
PatiantInformtion patientInformation,
FavoriteDiseaseDetails? searchDiagnosis,
String? diagnosisType,
String conditionType,
String remarks,
bool isNew) async {
setState(ViewState.BusyLocal);
bool result = await _SOAPService.createDiagnosisFromFavorite(
patientInformation,
searchDiagnosis,
diagnosisType,
conditionType,
remarks,
isNew);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
return result;
}
Future<bool> createProgressNote(PatiantInformtion patient, String? clinicID,
String conditionType, String note) async {
setState(ViewState.BusyLocal);
bool result = await _SOAPService.createProgressNote(
patient, clinicID, conditionType, note);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
return result;
}
Future<bool> editDiagnosis(PatientPreviousDiagnosis diagnosis) async {
setState(ViewState.BusyLocal);
@ -1420,9 +1472,13 @@ class SOAPViewModel extends BaseViewModel {
return result;
}
Future<bool> resolveDiagnosis(PatientPreviousDiagnosis diagnosis) async {
Future<bool> resolveDiagnosis(
PatientPreviousDiagnosis diagnosis, PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal);
bool result = await _SOAPService.resolveDiagnosis(diagnosis);
if (result) {
await getCurrentDiagnosisList(patientInfo);
}
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
@ -1464,4 +1520,42 @@ class SOAPViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
getPatientConditionList() async {
setState(ViewState.BusyLocal);
await _SOAPService.getPatientCondition();
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
/**
* function that checks if all the mandatory data is obtained from the subjective
* page
* @return [true] if the data is correctly inserted [false] if the data is incomplete
*/
bool isSubjectiveAssesmentCompleted() {
return getChiefComplaintListVidaPlus.isNotEmpty &&
getHopiDetails.isNotEmpty &&
patientAllergiesVidaPlus.isNotEmpty;
}
bool isPhysicalExaminationAdded() {
return patientPhysicalExaminationList.isNotEmpty;
}
bool isDiagnosticsAdded() {
return diagnosisList.isNotEmpty;
}
bool isProgressAdded() {
return progressNote.isNotEmpty;
}
void clearAllergy() {
_SOAPService.searchAllergiesList.clear();
notifyListeners();
}
}

@ -103,7 +103,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
},
child: Column(children: [
SizedBox(
height: 20,
height: 10,
),
SizedBox(

@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plu
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/assessment/widget/empty_diagnosis.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/widgets/SoapDetailItem.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.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';
@ -98,7 +99,7 @@ class _CurrentDiagnosisState extends State<CurrentDiagnosis> {
remarks:
widget.currentDiagnosisItems[index].remarks ??
'',
onSoapDetailActionClicked: (action) async{
onSoapDetailActionClicked: (action) async {
switch (action) {
case SoapDetailItemActions.AUDIT:
model.getAuditOfDiagnosis(
@ -113,26 +114,48 @@ class _CurrentDiagnosisState extends State<CurrentDiagnosis> {
context,
FadePage(
page: EditDiagnosis(
patientInfo: widget.patientInfo, diagnosis: widget.currentDiagnosisItems[index],
)));
patientInfo: widget.patientInfo,
diagnosis: widget
.currentDiagnosisItems[index],
)));
if (result) {
model.getCurrentDiagnosisList(widget.patientInfo);
model.getCurrentDiagnosisList(
widget.patientInfo);
}
break;
case SoapDetailItemActions.RESOLVE:
bool result = await model.resolveDiagnosis(widget.currentDiagnosisItems[index]);
if (widget.currentDiagnosisItems[index]
.resolved ==
true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.diagnosisAlreadyResolved);
}
bool result = await model.resolveDiagnosis(
widget.currentDiagnosisItems[index],
widget.patientInfo);
if (result) {
model.getCurrentDiagnosisList(widget.patientInfo);
model.getCurrentDiagnosisList(
widget.patientInfo);
}
break;
break;
case SoapDetailItemActions.REMOVE:
showConfirmationDialog(context,
"${TranslationBase.of(context).delete} ${TranslationBase.of(context).diagnosis}",
() {
widget.model
.removeDiagnosis(widget.patientInfo);
});
if (widget.currentDiagnosisItems[index]
.status ==
"Deleted") {
DrAppToastMsg.showErrorToast(TranslationBase.of(context).diagnosisAlreadyDeleted);
return;
}
showConfirmationDialog(context,
"${TranslationBase.of(context).delete} ${TranslationBase.of(context).diagnosis}",
(remarks) {
widget.model.removeDiagnosis(
widget.patientInfo,
widget.currentDiagnosisItems[index],
remarks);
});
case SoapDetailItemActions.CHANGE_STATUS:
// TODO: Handle this case.
default:
@ -150,7 +173,7 @@ class _CurrentDiagnosisState extends State<CurrentDiagnosis> {
}
showConfirmationDialog(
BuildContext context, String message, Function okFunction) {
BuildContext context, String message, Function(String) okFunction) {
return showDialog(
context: context,
barrierDismissible: true, // user must tap button!
@ -209,7 +232,14 @@ class _CurrentDiagnosisState extends State<CurrentDiagnosis> {
Expanded(
child: AppButton(
onPressed: () {
okFunction();
if (deleteController.text.isEmpty) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.remarksCanNotBeEmpty);
return;
;
}
okFunction(deleteController.text);
Navigator.of(context).pop();
},
title: TranslationBase.of(context).delete,

@ -49,7 +49,7 @@ class _EditDiagnosisState extends State<EditDiagnosis> {
void initState() {
super.initState();
filteredSearchController.text = widget.diagnosis.selectedDisease ?? '';
filteredSearchController.text = widget.diagnosis.remarks ?? '';
remarksController.text = widget.diagnosis.remarks ?? '';
status = widget.diagnosis.condition ?? '';
selectedDiagnosisItemValue = widget.diagnosis?.diagnosisType ?? '';
}
@ -58,12 +58,15 @@ class _EditDiagnosisState extends State<EditDiagnosis> {
if (_tTimer != null) {
_tTimer!.cancel();
}
if(text.isEmpty) return;
_tTimer = Timer(Duration(milliseconds: 500), () {
_onStopped(text);
});
}
void _onStopped(String searchText) async {
FocusScope.of(context).unfocus();
await model?.searchDiagnosis(widget.patientInfo, searchText);
}
@ -236,7 +239,7 @@ class _EditDiagnosisState extends State<EditDiagnosis> {
),
child: Container(
decoration: BoxDecoration(
color: status ==
color: status.toLowerCase() ==
model.conditionTypeList[index]
.toLowerCase()
? HexColor("#D02127")
@ -433,11 +436,11 @@ class _EditDiagnosisState extends State<EditDiagnosis> {
if (filteredSearchController.text ==
widget.diagnosis.selectedDisease &&
status == widget.diagnosis.condition &&
status.toLowerCase() == widget.diagnosis.condition?.toLowerCase() &&
widget.diagnosis.diagnosisType ==
selectedDiagnosisItem &&
selectedDiagnosisItemValue &&
widget.diagnosis.remarks ==
filteredSearchController.text) {
remarksController.text) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.noChangeRecorded);
@ -445,17 +448,25 @@ class _EditDiagnosisState extends State<EditDiagnosis> {
}
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;
widget.diagnosis.remarks =
remarksController.text;
if(selectedDiagnosis != null ) {
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);

@ -45,12 +45,14 @@ class _EnterDiagnosisState extends State<EnterDiagnosis> {
if (_tTimer != null) {
_tTimer!.cancel();
}
if(text.isEmpty) return;
_tTimer = Timer(Duration(milliseconds: 500), () {
_onStopped(text);
});
}
void _onStopped(String searchText) async {
FocusScope.of(context).unfocus();
await model?.searchDiagnosis(widget.patientInfo, searchText);
}

@ -2,12 +2,14 @@ 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/FavoriteDiseaseDetails.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/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -33,8 +35,9 @@ class _FavoriteDiagnosisState extends State<FavoriteDiagnosis> {
TextEditingController();
bool showAllDiagnosis = true;
String status = '';
String? selectedItem;
String? selectedFavorite;
String? selectedDiagnosisItem;
String? selectedDiagnosisItemValue;
FavoriteDiseaseDetails? selectedFavorite;
TextEditingController remarksController = TextEditingController();
Timer? _tTimer;
SOAPViewModel? model;
@ -106,7 +109,7 @@ class _FavoriteDiagnosisState extends State<FavoriteDiagnosis> {
model.favoriteDiagnosisDetails.isEmpty
? EmptyDropDown()
: DropdownButtonHideUnderline(
child: DropdownButton(
child: DropdownButton<FavoriteDiseaseDetails>(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
icon: Icon(Icons.keyboard_arrow_down),
@ -114,7 +117,6 @@ class _FavoriteDiagnosisState extends State<FavoriteDiagnosis> {
itemHeight: null,
value: selectedFavorite == null
? model.favoriteDiagnosisDetails.first
.diseases
: selectedFavorite,
iconSize: 25,
elevation: 16,
@ -135,7 +137,7 @@ class _FavoriteDiagnosisState extends State<FavoriteDiagnosis> {
fontWeight: FontWeight.normal,
textAlign: TextAlign.left,
),
value: item.diseases,
value: item,
);
}).toList(),
),
@ -355,42 +357,39 @@ class _FavoriteDiagnosisState extends State<FavoriteDiagnosis> {
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(),
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;
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(),
),
),
],
),
),
@ -452,7 +451,32 @@ class _FavoriteDiagnosisState extends State<FavoriteDiagnosis> {
title: TranslationBase.of(context).save,
fontWeight: FontWeight.w600,
color: Color(0xFF359846),
onPressed: () async {},
onPressed: () async {
selectedDiagnosisItem ??= model.diagnosisTypeList.keys.first;
selectedDiagnosisItemValue = model.diagnosisTypeList[selectedDiagnosisItem];
selectedFavorite ??=model.favoriteDiagnosisDetails.first;
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.createDiagnosisFromFavorite(
widget.patientInfo,
selectedFavorite,
selectedDiagnosisItemValue,
status,
remarksController.text,
false);
if (result) {
Navigator.pop(context, result);
}
},
),
),
],

@ -50,6 +50,7 @@ class PreviousDiagnosis extends StatelessWidget {
status: diagnosisItems[index].status ?? '',
condition: diagnosisItems[index].condition ?? '',
remarks: diagnosisItems[index].remarks ?? '',
isPreviousAddedToCurrent:diagnosisItems[index].visitWisePatientDiagnoses == true ,
onSoapDetailActionClicked: (action) {
switch (action) {
case SoapDetailItemActions.AUDIT:

@ -13,6 +13,7 @@ class PreviousDiagnosisItem extends StatelessWidget {
final String condition;
final String status;
final String remarks;
final bool isPreviousAddedToCurrent;
final OnSoapDetailActionClicked onSoapDetailActionClicked;
const PreviousDiagnosisItem(
@ -21,80 +22,82 @@ class PreviousDiagnosisItem extends StatelessWidget {
required this.condition,
required this.remarks,
required this.onSoapDetailActionClicked,
required this.status});
required this.status,
required this.isPreviousAddedToCurrent});
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Stack(
// children: [
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
title,
color: Color(0XFF2B353E),
fontSize: 12,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 4,
),
Row(
children: [
AppText(
title,
"${TranslationBase.of(context).condition}:",
color: Color(0XFF2B353E),
fontSize: 12,
fontWeight: FontWeight.bold,
fontSize: 10,
fontWeight: FontWeight.w500,
),
SizedBox(height: 4,),
Row(
children: [
AppText(
"${TranslationBase.of(context).condition}:",
color: Color(0XFF2B353E),
fontSize: 10,
fontWeight: FontWeight.w500,
),
SizedBox(
width: 4,
),
AppText(
condition,
color: Color(0xffD02127),
fontSize: 10,
fontWeight: FontWeight.w500,
),
],
SizedBox(
width: 4,
),
AppText(
condition,
color: Color(0xffD02127),
fontSize: 10,
fontWeight: FontWeight.w500,
),
],
),
),
Status(status: status),
],
],
),
),
Visibility(
visible: remarks.isNotEmpty,
child: Column(
children: [
SizedBox(
height: 8,
),
AppText(
remarks,
color: Color(0XFF2B353E),
fontSize: 10,
fontWeight: FontWeight.w400,
),
],
))
Status(status: status),
],
),
// Align(
// alignment: Alignment.topRight, child: Status(status: status))
// ],
Visibility(
visible: remarks.isNotEmpty,
child: Column(
children: [
SizedBox(
height: 8,
),
AppText(
remarks,
color: Color(0XFF2B353E),
fontSize: 10,
fontWeight: FontWeight.w400,
),
],
))
],
),
// Align(
// alignment: Alignment.topRight, child: Status(status: status))
// ],
// ),
SizedBox(
height: 16,
@ -120,15 +123,23 @@ class PreviousDiagnosisItem extends StatelessWidget {
width: 187,
height: 27,
child: Material(
color: HexColor("#D02127"),
shape: RoundedRectangleBorder(borderRadius:BorderRadius.circular(5.0)) ,
color: isPreviousAddedToCurrent
? Color(0xffEAEAEA)
: HexColor("#D02127"),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0)),
child: InkWell(
onTap: () {
onSoapDetailActionClicked(
SoapDetailItemActions.CHANGE_STATUS);
},
child:Center(child: AppText( TranslationBase.of(context).makeCurrentDiagnosis, color: Colors.white,)),
),
onTap: () {
if (!isPreviousAddedToCurrent) // to make it clickable if it has not been added to the current diagnosis
onSoapDetailActionClicked(
SoapDetailItemActions.CHANGE_STATUS);
},
child: Center(
child: AppText(
TranslationBase.of(context).makeCurrentDiagnosis,
color: Colors.white,
)),
),
),
)
],

@ -145,7 +145,7 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
title: TranslationBase.of(context)
.addProgressNote,
onAddSoapItemClicked: () {
navigateToAddPlan();
navigateToAddPlan(model);
}),
SizedBox(
height: 16,
@ -385,11 +385,15 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
//todo handle the next event here
}
void navigateToAddPlan() {
Navigator.push(
void navigateToAddPlan(SOAPViewModel model) async{
bool result = await Navigator.push(
context,
FadePage(
page: AddProgressNote(),
page: AddProgressNote(information: widget.patientInfo,),
));
if(result){
model.getProgressNote(widget.patientInfo);
}
}
}

@ -1,20 +1,49 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/Clinic.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/PatientCondition.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/project_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/plan/widget/add_progress_note_details.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:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class AddProgressNote extends StatefulWidget{
final PatiantInformtion information;
const AddProgressNote({super.key, required this.information});
@override
State<AddProgressNote> createState() => _AddProgressNoteState();
}
class _AddProgressNoteState extends State<AddProgressNote> {
SOAPClinic? selectedClinicItem;
PatientCondition? selectedPatientConditionItem;
int status = 1;
final TextEditingController noteController = TextEditingController();
class AddProgressNote extends StatelessWidget{
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<SOAPViewModel>(
onModelReady: (model){
WidgetsBinding.instance.addPostFrameCallback((_) async {
model.getClinics();
model.getPatientConditionList();
});
},
builder: (_, model, w) => AppScaffold(
@ -26,7 +55,251 @@ class AddProgressNote extends StatelessWidget{
body: Padding(
padding: const EdgeInsets.all(20.0),
child: SingleChildScrollView(
child: AddProgressNoteDetails(),
child: 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).addProgressNote,
fontSize: 16,
fontWeight: FontWeight.w600,
textAlign: TextAlign.start,
color: Colors.black,
),
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).patientCondition,
textAlign: TextAlign.start,
fontWeight: FontWeight.w600,
fontSize: 11,
color: Color(0xFF2E303A),
),
SizedBox(
height: 4,
),
model.patientConditionList.isEmpty
? EmptyDropDown()
: DropdownButtonHideUnderline(
child: DropdownButton<PatientCondition>(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
icon: Icon(Icons.keyboard_arrow_down),
isExpanded: true,
value:
selectedPatientConditionItem == null
? model.patientConditionList.first
: selectedPatientConditionItem,
iconSize: 25,
elevation: 16,
onChanged: (newValue) async {
setState(() {
selectedPatientConditionItem =
newValue;
});
},
items: model.patientConditionList
.map((item) {
return DropdownMenuItem(
child: AppText(
item.name ?? '',
fontSize: 14,
letterSpacing: -0.96,
color: AppGlobal.appTextColor,
fontWeight: FontWeight.normal,
textAlign: TextAlign.left,
),
value: item,
);
}).toList(),
),
),
],
),
),
),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).progressNoteType,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 11,
),
SizedBox(
height: 8,
),
Row(
children: [
Flexible(
child: InkWell(
onTap: () {
setState(() {
status = 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: status == 1
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
AppText(
TranslationBase.of(context).doctorProgressNote,
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(
height: 4,
),
model.clinics.isEmpty
? EmptyDropDown()
: DropdownButtonHideUnderline(
child: DropdownButton<SOAPClinic>(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
icon: Icon(Icons.keyboard_arrow_down),
isExpanded: true,
value: selectedClinicItem == null
? model.clinics.first
: selectedClinicItem,
iconSize: 25,
elevation: 16,
onChanged: (newValue) async {
setState(() {
selectedClinicItem = 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),
// ),
// ],
// )
],
),
),
),
),
),
bottomNavigationBar: Material(
@ -56,9 +329,16 @@ class AddProgressNote extends StatelessWidget{
fontColor: Colors.white,
fontWeight: FontWeight.w600,
onPressed: () async {
Navigator.pop(context);
selectedPatientConditionItem ??= model.patientConditionList.first;
selectedClinicItem ??= model.clinics.first;
if(noteController.text.isEmpty){
DrAppToastMsg.showErrorToast(TranslationBase.of(context).progressNoteCanNotBeEmpty);
return;
}
bool result = await model.createProgressNote(widget.information, selectedClinicItem?.clinicID?.toString(), selectedPatientConditionItem?.code ?? '',noteController.text );
Navigator.pop(context, result);
},
),
@ -68,5 +348,4 @@ class AddProgressNote extends StatelessWidget{
),
);
}
}

@ -1,5 +1,6 @@
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/progress_note/PatientCondition.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';
@ -21,7 +22,10 @@ class AddProgressNoteDetails extends StatefulWidget {
}
class _AddProgressNoteDetailsState extends State<AddProgressNoteDetails> {
Clinic? selectedItem ;
SOAPClinic? selectedClinicItem;
PatientCondition? selectedPatientConditionItem;
int status = 1;
final TextEditingController noteController = TextEditingController();
@ -77,28 +81,31 @@ class _AddProgressNoteDetailsState extends State<AddProgressNoteDetails> {
SizedBox(
height: 4,
),
model.clinics.isEmpty
model.patientConditionList.isEmpty
? EmptyDropDown()
: DropdownButtonHideUnderline(
child: DropdownButton<Clinic>(
child: DropdownButton<PatientCondition>(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
icon: Icon(Icons.keyboard_arrow_down),
isExpanded: true,
value: selectedItem == null ? model.clinics.first : selectedItem,
value:
selectedPatientConditionItem == null
? model.patientConditionList.first
: selectedPatientConditionItem,
iconSize: 25,
elevation: 16,
onChanged: (newValue) async {
setState(() {
selectedItem = newValue;
selectedPatientConditionItem =
newValue;
});
},
items: model.clinics.map((item) {
items: model.patientConditionList
.map((item) {
return DropdownMenuItem(
child: AppText(
projectViewModel.isArabic
? item.clinicNameArabic ?? ''
: item.clinicNameEnglish ?? '',
item.name ?? '',
fontSize: 14,
letterSpacing: -0.96,
color: AppGlobal.appTextColor,
@ -166,45 +173,6 @@ class _AddProgressNoteDetailsState extends State<AddProgressNoteDetails> {
],
),
)),
Flexible(
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).nurseNote,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
fontSize: 12,
),
],
),
),
),
],
),
SizedBox(
@ -237,36 +205,38 @@ class _AddProgressNoteDetailsState extends State<AddProgressNoteDetails> {
model.clinics.isEmpty
? EmptyDropDown()
: 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,
child: DropdownButton<SOAPClinic>(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
icon: Icon(Icons.keyboard_arrow_down),
isExpanded: true,
value: selectedClinicItem == null
? model.clinics.first
: selectedClinicItem,
iconSize: 25,
elevation: 16,
onChanged: (newValue) async {
setState(() {
selectedClinicItem = 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(),
),
value: item,
);
}).toList(),
),
),
),
],
),
),
@ -288,22 +258,22 @@ class _AddProgressNoteDetailsState extends State<AddProgressNoteDetails> {
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),
),
],
)
// 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,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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -38,12 +39,15 @@ class _AddAllergiesState extends State<AddAllergies> {
@override
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
onModelReady: (model){
WidgetsBinding.instance.addPostFrameCallback((_) {
model.clearAllergy();
});
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
isLoading: model.state == ViewState.BusyLocal,
appBar: PatientSearchHeader(
title: TranslationBase.of(context).addAllergies),
body: MasterKeyCheckboxSearchAllergiesWidget(
model: model,
@ -61,47 +65,4 @@ class _AddAllergiesState extends State<AddAllergies> {
)),
);
}
//
// isServiceSelected(MasterKeyModel masterKey) {
// Iterable<MySelectedAllergy> allergy =
// myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy!.id && masterKey.typeId == element.selectedAllergy!.typeId && element.isChecked);
// if (allergy.length > 0) {
// return true;
// }
// return false;
// }
//
// removeAllergyFromLocalList(MasterKeyModel masterKey) {
// myAllergiesListLocal.removeWhere((element) => element.selectedAllergy!.id == masterKey.id);
// }
//
// MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) {
// Iterable<MySelectedAllergy> allergy =
// myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy!.id && masterKey.typeId == element.selectedAllergy!.typeId && element.isChecked);
// if (allergy.length > 0) {
// return allergy.first;
// }
// return MySelectedAllergy();
// }
//
// addAllergyLocally(AllergiesListVidaPlus mySelectedAllergy) {
// if (mySelectedAllergy.selectedAllergy == null) {
// Utils.showErrorToast(TranslationBase.of(context).requiredMsg);
// } else {
// setState(() {
// List<MySelectedAllergy> allergy =
// // ignore: missing_return
// myAllergiesListLocal.where((element) => mySelectedAllergy.selectedAllergy!.id == element.selectedAllergy!.id).toList();
//
// if (allergy.isEmpty) {
// myAllergiesListLocal.add(mySelectedAllergy);
// } else {
// allergy.first.selectedAllergy = mySelectedAllergy.selectedAllergy;
// allergy.first.selectedAllergySeverity = mySelectedAllergy.selectedAllergySeverity;
// allergy.first.remark = mySelectedAllergy.remark;
// allergy.first.isChecked = mySelectedAllergy.isChecked;
// }
// });
// }
// }
}

@ -15,132 +15,151 @@ import '../../../../../../core/model/patient/patiant_info_model.dart';
import '../../../../../../widgets/transitions/fade_page.dart';
import '../../objective/widget/EmptyExamination.dart';
class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
final SOAPViewModel model;
final String? buttonName;
final String? hintSearchText;
final PatientAllergiesVidaPlus? myAllergiesList;
final PatiantInformtion patientInfo;
MasterKeyCheckboxSearchAllergiesWidget(
{Key? key,
required this.model,
this.myAllergiesList,
required this.patientInfo,
this.buttonName,
this.hintSearchText,
})
: super(key: key);
MasterKeyCheckboxSearchAllergiesWidget({
Key? key,
required this.model,
this.myAllergiesList,
required this.patientInfo,
this.buttonName,
this.hintSearchText,
}) : super(key: key);
@override
_MasterKeyCheckboxSearchAllergiesWidgetState createState() => _MasterKeyCheckboxSearchAllergiesWidgetState();
_MasterKeyCheckboxSearchAllergiesWidgetState createState() =>
_MasterKeyCheckboxSearchAllergiesWidgetState();
}
class _MasterKeyCheckboxSearchAllergiesWidgetState extends State<MasterKeyCheckboxSearchAllergiesWidget> {
class _MasterKeyCheckboxSearchAllergiesWidgetState
extends State<MasterKeyCheckboxSearchAllergiesWidget> {
// List<MasterKeyModel> items = [];
bool loading =false;
bool loading = false;
TextEditingController filteredSearchController = TextEditingController();
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Expanded(
child: Container(
margin: EdgeInsets.all(20),
height: Utils.getTextFieldHeight(),
child: Center(
child: Container(
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12)),
child: Column(
children: [
AppTextFieldCustom(
hintText: TranslationBase.of(context).selectAllergy,
isTextFieldHasSuffix: true,
hasBorder: true,
controller: filteredSearchController,
onChanged: (value) {
// filterSearchResults(value);
},
onFieldSubmitted: () {
},
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Color(0xff2B353E
),
size: 30,
),
onPressed: () {
loading =true;
widget.model.searchAllergies(filteredSearchController.text);
},
),
),
// DividerWithSpacesAround(),
SizedBox(
height: 10,
),
Expanded(
child: RoundedContainer(
width:MediaQuery.of(context).size.width ,
height: MediaQuery.of(context).size.height * 0.60,
child: widget.model.state == ViewState.Idle
? ListView.builder(
itemCount: widget.model.searchAllergiesVidaPlus.length,
itemBuilder: (context, index) {
loading =false;
return ListTile(title: AppText(widget.model.searchAllergiesVidaPlus[index].allergyName!), trailing: TextButton.icon(icon: SvgPicture.asset("assets/images/svgs/add-square.svg", color: Color(0xffD02127),), style: ButtonStyle(iconColor: WidgetStateProperty.all<Color>(Color(0xffD02127)), ), onPressed: (){
openReaction(widget.model, widget.model.searchAllergiesVidaPlus[index]);
}, label: AppText(TranslationBase.of(context).add, fontSize:12, color:Color(0xffD02127) ,),
),
);
},
)
: widget.model.state == ViewState.BusyLocal ? Center(child: CircularProgressIndicator()) :Center(child: EmptyWidget(TranslationBase.of(context).noDataAvailable))
return Column(
children: [
Expanded(
child: Container(
margin: EdgeInsets.all(20),
height: Utils.getTextFieldHeight(),
child: Center(
child: Container(
decoration:
BoxDecoration(borderRadius: BorderRadius.circular(12)),
child: Column(
children: [
AppTextFieldCustom(
hintText: TranslationBase.of(context).selectAllergy,
isTextFieldHasSuffix: true,
hasBorder: true,
controller: filteredSearchController,
onChanged: (value) {
// filterSearchResults(value);
},
onFieldSubmitted: () {
},
onEditingComplete: (){
loading = true;
if(filteredSearchController.text.isNotEmpty) {
widget.model
.searchAllergies(filteredSearchController.text);
}
},
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Color(0xff2B353E),
size: 30,
),
onPressed: () {
loading = true;
widget.model
.searchAllergies(filteredSearchController.text);
},
),
],
),
),
// DividerWithSpacesAround(),
SizedBox(
height: 10,
),
Expanded(
child: RoundedContainer(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height * 0.60,
child: widget.model.searchAllergiesVidaPlus.isEmpty
? Center(
child: EmptyWidget(
TranslationBase.of(context)
.noDataAvailable))
: ListView.builder(
itemCount: widget
.model.searchAllergiesVidaPlus.length,
itemBuilder: (context, index) {
loading = false;
return ListTile(
title: AppText(widget
.model
.searchAllergiesVidaPlus[index]
.allergyName!),
trailing: TextButton.icon(
icon: SvgPicture.asset(
"assets/images/svgs/add-square.svg",
color: Color(0xffD02127),
),
style: ButtonStyle(
iconColor:
WidgetStateProperty.all<
Color>(Color(0xffD02127)),
),
onPressed: () {
openReaction(
widget.model,
widget.model
.searchAllergiesVidaPlus[
index]);
},
label: AppText(
TranslationBase.of(context).add,
fontSize: 12,
color: Color(0xffD02127),
),
),
);
},
)
),
),
],
),
),
),
),
],
),
],
);
}
openReaction(model, AllergiesListVidaPlus mySelectedAllergy){
Navigator.of(context).pop();
Navigator.push(
context,
FadePage(
page:ReactionsSelectionAllergiesWidget(
model:model,
mySelectedAllergy: mySelectedAllergy,
patientInfo: widget.patientInfo
)
));
openReaction(model, AllergiesListVidaPlus mySelectedAllergy) {
Navigator.of(context).pop();
Navigator.push(
context,
FadePage(
page: ReactionsSelectionAllergiesWidget(
model: model,
mySelectedAllergy: mySelectedAllergy,
patientInfo: widget.patientInfo)));
}
}

@ -1,4 +1,5 @@
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/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/patient/patiant_info_model.dart';
@ -56,9 +57,7 @@ class _ReactionsSelectionAllergiesWidgetState
builder: (_, model, w) => AppScaffold(
isLoading: loading,
appBar: PatientSearchHeader(
title: widget.mySelectedAllergy != null
? widget.mySelectedAllergy!.allergyName
: widget.editSelectedAllergy!.allergyName),
title: TranslationBase.of(context).selectReaction),
body: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -66,7 +65,7 @@ class _ReactionsSelectionAllergiesWidgetState
widget.mySelectedAllergy != null
? Expanded(
child: RoundedContainer(
margin: EdgeInsets.only(top:10, left: 15, right: 15, bottom: 10),
margin: EdgeInsets.only(top:6, left: 15, right: 15, bottom: 6),
child: ListView.builder(
itemCount: widget.mySelectedAllergy!
.allergyReactionDTOs!.length,
@ -108,11 +107,12 @@ class _ReactionsSelectionAllergiesWidgetState
.allergyReactionName!),
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: ListTile(
contentPadding: EdgeInsets.zero ,
title: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
@ -147,6 +147,7 @@ class _ReactionsSelectionAllergiesWidgetState
))),
Expanded(
child: ListTile(
contentPadding: EdgeInsets.zero ,
title: Row(
children: <Widget>[
Radio(
@ -180,6 +181,8 @@ class _ReactionsSelectionAllergiesWidgetState
))),
Expanded(
child: ListTile(
contentPadding: EdgeInsets.zero ,
title: Row(
children: <Widget>[
Radio(
@ -215,7 +218,7 @@ class _ReactionsSelectionAllergiesWidgetState
)
],
),
Divider(),
// Divider(),
]);
},
)))
@ -263,6 +266,8 @@ class _ReactionsSelectionAllergiesWidgetState
children: [
Expanded(
child: ListTile(
contentPadding: EdgeInsets.zero ,
title: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
@ -305,6 +310,8 @@ class _ReactionsSelectionAllergiesWidgetState
))),
Expanded(
child: ListTile(
contentPadding: EdgeInsets.zero ,
title: Row(
children: <Widget>[
Radio(
@ -346,6 +353,8 @@ class _ReactionsSelectionAllergiesWidgetState
))),
Expanded(
child: ListTile(
contentPadding: EdgeInsets.zero ,
title: Row(
children: <Widget>[
Radio(

@ -253,7 +253,11 @@ class UpdatePresentIllnessState extends State<UpdatePresentIllness> {
"hpiTakenOtherText": otherController.text,
"hpiTakenFamilyText": familyController.text,
};
await model!.saveHopi(request, widget.patientInfo!);
bool result = await model!.saveHopi(request, widget.patientInfo!);
if(result){
getHopi(model);
}
GifLoaderDialogUtils.hideDialog(context);
}
getHopi(SOAPViewModel model) async{

@ -174,10 +174,10 @@ class _UpdateSoapIndexVidaPlusState extends State<UpdateSoapIndexVidaPlus>
child: AppButton(
title: TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
disabled: !model.isSubjectiveAssesmentCompleted(),
color: Colors.red[700]!,
onPressed: () async {
changePageViewIndex(1);
//model.nextOnSubjectPage(model);
},
),
);
@ -217,7 +217,7 @@ class _UpdateSoapIndexVidaPlusState extends State<UpdateSoapIndexVidaPlus>
// height: SizeConfig.heightMultiplier! *
// (SizeConfig.isHeightVeryShort ? 8 : 6),
// padding: 10,
disabled: model.state == ViewState.BusyLocal,
disabled: model.state == ViewState.BusyLocal || !model.isPhysicalExaminationAdded(),
onPressed: () async {
changePageViewIndex(2);
// await model.nextOnObjectivePage(model);
@ -254,7 +254,7 @@ class _UpdateSoapIndexVidaPlusState extends State<UpdateSoapIndexVidaPlus>
title: TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
color: Colors.red[700]!,
disabled: model.state == ViewState.BusyLocal,
disabled: model.state == ViewState.BusyLocal || !model.isDiagnosticsAdded(),
onPressed: () async {
changePageViewIndex(3);
},
@ -292,7 +292,7 @@ class _UpdateSoapIndexVidaPlusState extends State<UpdateSoapIndexVidaPlus>
: TranslationBase.of(context).finish,
fontWeight: FontWeight.w600,
color: Colors.red[700]!,
disabled: model.progressNoteText.isEmpty,
disabled: !model.isProgressAdded(),
onPressed: () async {
changePageViewIndex(3);
// model.nextOnPlanPage(model);

@ -10,6 +10,7 @@ class SoapDetailItem extends StatelessWidget {
final String condition;
final String status;
final String remarks;
final bool showActions;
final OnSoapDetailActionClicked onSoapDetailActionClicked;
const SoapDetailItem(
@ -18,7 +19,8 @@ class SoapDetailItem extends StatelessWidget {
required this.condition,
required this.remarks,
required this.onSoapDetailActionClicked,
required this.status});
required this.status,
this.showActions = true});
@override
Widget build(BuildContext context) {
@ -112,7 +114,7 @@ class SoapDetailItem extends StatelessWidget {
onSoapDetailActionClicked(SoapDetailItemActions.AUDIT),
child: SoapDetailItemActionsView(
icon: 'assets/images/svgs/audit.svg',
fontColor: Color(0XFF359846),
fontColor: Color(0XFF2B353E),
text: TranslationBase.of(context).audit,
),
),

@ -1952,6 +1952,11 @@ class TranslationBase {
String get activate => localizedValues['activate']![locale.languageCode]!;
String get resolved => localizedValues['resolved']![locale.languageCode]!;
String get selectReaction => localizedValues['selectReaction']![locale.languageCode]!;
String get progressNoteCanNotBeEmpty => localizedValues['progressNoteCanNotBeEmpty']![locale.languageCode]!;
String get diagnosisAlreadyResolved => localizedValues['diagnosisAlreadyResolved']![locale.languageCode]!;
String get diagnosisAlreadyDeleted => localizedValues['diagnosisAlreadyDeleted']![locale.languageCode]!;
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -27,6 +27,7 @@ class AppTextFieldCustom extends StatefulWidget {
final List<TextInputFormatter>? inputFormatters;
final Function(String? value) onChanged;
final Function() onFieldSubmitted;
final VoidCallback? onEditingComplete;
final String? validationError;
final bool isPrscription;
@ -57,6 +58,7 @@ class AppTextFieldCustom extends StatefulWidget {
this.focus = false,
this.isSearchTextField = false,
required this.onFieldSubmitted,
this.onEditingComplete
});
@override
@ -161,6 +163,10 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
}
},
child: TextFormField(
textInputAction: TextInputAction.search,
onEditingComplete: (){
widget.onEditingComplete?.call();
},
textAlign: projectViewModel.isArabic
? TextAlign.right
: TextAlign.left,
@ -192,6 +198,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
}
setState(() {});
},
onFieldSubmitted:
widget.onFieldSubmitted(),
obscureText: widget.isSecure),

Loading…
Cancel
Save