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