|
|
|
@ -8,8 +8,11 @@ import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_re
|
|
|
|
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/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';
|
|
|
|
|
|
|
|
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/post_chief_complaint_request_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/post_chief_complaint_request_model.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/search_chief_complaint_vidaplus.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/general_get_req_for_SOAP.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/general_get_req_for_SOAP.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/get_hopi_details.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/history/get_history_req_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/history/get_history_req_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/history/get_history_res_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/history/get_history_res_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/history/post_histories_request_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/history/post_histories_request_model.dart';
|
|
|
|
@ -42,51 +45,74 @@ import 'base_view_model.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class SOAPViewModel extends BaseViewModel {
|
|
|
|
class SOAPViewModel extends BaseViewModel {
|
|
|
|
SOAPService _SOAPService = locator<SOAPService>();
|
|
|
|
SOAPService _SOAPService = locator<SOAPService>();
|
|
|
|
|
|
|
|
|
|
|
|
PrescriptionService _prescriptionService = locator<PrescriptionService>();
|
|
|
|
PrescriptionService _prescriptionService = locator<PrescriptionService>();
|
|
|
|
|
|
|
|
|
|
|
|
List<MasterKeyModel> get allergiesList => _SOAPService.allergiesList;
|
|
|
|
List<MasterKeyModel> get allergiesList => _SOAPService.allergiesList;
|
|
|
|
|
|
|
|
|
|
|
|
List<MasterKeyModel> get allergySeverityList => _SOAPService.allergySeverityList;
|
|
|
|
List<MasterKeyModel> get allergySeverityList =>
|
|
|
|
|
|
|
|
_SOAPService.allergySeverityList;
|
|
|
|
|
|
|
|
|
|
|
|
List<MasterKeyModel> get historyFamilyList => _SOAPService.historyFamilyList;
|
|
|
|
List<MasterKeyModel> get historyFamilyList => _SOAPService.historyFamilyList;
|
|
|
|
|
|
|
|
|
|
|
|
List<MasterKeyModel> get historyMedicalList => _SOAPService.historyMedicalList;
|
|
|
|
List<MasterKeyModel> get historyMedicalList =>
|
|
|
|
|
|
|
|
_SOAPService.historyMedicalList;
|
|
|
|
|
|
|
|
|
|
|
|
List<MasterKeyModel> get historySportList => _SOAPService.historySportList;
|
|
|
|
List<MasterKeyModel> get historySportList => _SOAPService.historySportList;
|
|
|
|
|
|
|
|
|
|
|
|
List<MasterKeyModel> get historySocialList => _SOAPService.historySocialList;
|
|
|
|
List<MasterKeyModel> get historySocialList => _SOAPService.historySocialList;
|
|
|
|
|
|
|
|
|
|
|
|
List<MasterKeyModel> get historySurgicalList => _SOAPService.historySurgicalList;
|
|
|
|
List<MasterKeyModel> get historySurgicalList =>
|
|
|
|
|
|
|
|
_SOAPService.historySurgicalList;
|
|
|
|
|
|
|
|
|
|
|
|
List<MasterKeyModel> get mergeHistorySurgicalWithHistorySportList => [...historySurgicalList, ...historySportList];
|
|
|
|
List<MasterKeyModel> get mergeHistorySurgicalWithHistorySportList =>
|
|
|
|
|
|
|
|
[...historySurgicalList, ...historySportList];
|
|
|
|
|
|
|
|
|
|
|
|
List<MasterKeyModel> get physicalExaminationList => _SOAPService.physicalExaminationList;
|
|
|
|
List<MasterKeyModel> get physicalExaminationList =>
|
|
|
|
|
|
|
|
_SOAPService.physicalExaminationList;
|
|
|
|
|
|
|
|
|
|
|
|
List<MasterKeyModel> get listOfDiagnosisType => _SOAPService.listOfDiagnosisType;
|
|
|
|
List<MasterKeyModel> get listOfDiagnosisType =>
|
|
|
|
|
|
|
|
_SOAPService.listOfDiagnosisType;
|
|
|
|
|
|
|
|
|
|
|
|
List<MasterKeyModel> get listOfDiagnosisCondition => _SOAPService.listOfDiagnosisCondition;
|
|
|
|
List<MasterKeyModel> get listOfDiagnosisCondition =>
|
|
|
|
|
|
|
|
_SOAPService.listOfDiagnosisCondition;
|
|
|
|
|
|
|
|
|
|
|
|
List<MasterKeyModel> get listOfICD10 => _SOAPService.listOfICD10;
|
|
|
|
List<MasterKeyModel> get listOfICD10 => _SOAPService.listOfICD10;
|
|
|
|
|
|
|
|
|
|
|
|
List<GetChiefComplaintResModel> get patientChiefComplaintList => _SOAPService.patientChiefComplaintList;
|
|
|
|
List<GetChiefComplaintResModel> get patientChiefComplaintList =>
|
|
|
|
|
|
|
|
_SOAPService.patientChiefComplaintList;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<GetAllergiesResModel> get patientAllergiesList =>
|
|
|
|
|
|
|
|
_SOAPService.patientAllergiesList;
|
|
|
|
|
|
|
|
|
|
|
|
List<GetAllergiesResModel> get patientAllergiesList => _SOAPService.patientAllergiesList;
|
|
|
|
List<GetHistoryResModel> get patientHistoryList =>
|
|
|
|
|
|
|
|
_SOAPService.patientHistoryList;
|
|
|
|
|
|
|
|
|
|
|
|
List<GetHistoryResModel> get patientHistoryList => _SOAPService.patientHistoryList;
|
|
|
|
List<GetPhysicalExamResModel> get patientPhysicalExamList =>
|
|
|
|
|
|
|
|
_SOAPService.patientPhysicalExamList;
|
|
|
|
|
|
|
|
|
|
|
|
List<GetPhysicalExamResModel> get patientPhysicalExamList => _SOAPService.patientPhysicalExamList;
|
|
|
|
List<GetPatientProgressNoteResModel> get patientProgressNoteList =>
|
|
|
|
|
|
|
|
_SOAPService.patientProgressNoteList;
|
|
|
|
|
|
|
|
|
|
|
|
List<GetPatientProgressNoteResModel> get patientProgressNoteList => _SOAPService.patientProgressNoteList;
|
|
|
|
List<GetAssessmentResModel> get patientAssessmentList =>
|
|
|
|
|
|
|
|
_SOAPService.patientAssessmentList;
|
|
|
|
|
|
|
|
|
|
|
|
List<GetAssessmentResModel> get patientAssessmentList => _SOAPService.patientAssessmentList;
|
|
|
|
List<AllergiesListVidaPlus> get searchAllergiesVidaPlus =>
|
|
|
|
|
|
|
|
_SOAPService.searchAllergiesList;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<PatientAllergiesVidaPlus> get patientAllergiesVidaPlus =>
|
|
|
|
|
|
|
|
_SOAPService.patientAllergiesVidaPlus;
|
|
|
|
|
|
|
|
|
|
|
|
List<AllergiesListVidaPlus> get searchAllergiesVidaPlus => _SOAPService.searchAllergiesList;
|
|
|
|
List<GetHopiDetails> get getHopiDetails => _SOAPService.hopiDetails;
|
|
|
|
|
|
|
|
|
|
|
|
List<PatientAllergiesVidaPlus> get patientAllergiesVidaPlus => _SOAPService.patientAllergiesVidaPlus;
|
|
|
|
List<SearchChiefComplaint> get searchChiefComplaintList =>
|
|
|
|
|
|
|
|
_SOAPService.searchChiefComplaintListVidaPlus;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<GetChiefComplaintVidaPlus> get getChiefComplaintListVidaPlus =>
|
|
|
|
|
|
|
|
_SOAPService.patientChiefComplaintListVidaPlus;
|
|
|
|
|
|
|
|
|
|
|
|
int? get episodeID => _SOAPService.episodeID;
|
|
|
|
int? get episodeID => _SOAPService.episodeID;
|
|
|
|
|
|
|
|
|
|
|
|
bool get isPrescriptionOrder => _SOAPService.isPrescriptionOrder;
|
|
|
|
bool get isPrescriptionOrder => _SOAPService.isPrescriptionOrder;
|
|
|
|
bool isAddProgress = true;
|
|
|
|
bool isAddProgress = true;
|
|
|
|
bool isAddExamInProgress = true;
|
|
|
|
bool isAddExamInProgress = true;
|
|
|
|
@ -103,7 +129,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
|
|
|
|
|
|
|
get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel;
|
|
|
|
get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel;
|
|
|
|
|
|
|
|
|
|
|
|
List<GetMedicationResponseModel>? get allMedicationList => _prescriptionService.allMedicationList;
|
|
|
|
List<GetMedicationResponseModel>? get allMedicationList =>
|
|
|
|
|
|
|
|
_prescriptionService.allMedicationList;
|
|
|
|
|
|
|
|
|
|
|
|
late SubjectiveCallBack subjectiveCallBack;
|
|
|
|
late SubjectiveCallBack subjectiveCallBack;
|
|
|
|
|
|
|
|
|
|
|
|
@ -145,7 +172,10 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
planCallBack.nextFunction(model);
|
|
|
|
planCallBack.nextFunction(model);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false, String searchKey = "", bool allowSetState = false}) async {
|
|
|
|
Future getMasterLookup(MasterKeysService masterKeys,
|
|
|
|
|
|
|
|
{bool isBusyLocal = false,
|
|
|
|
|
|
|
|
String searchKey = "",
|
|
|
|
|
|
|
|
bool allowSetState = false}) async {
|
|
|
|
if (isBusyLocal) {
|
|
|
|
if (isBusyLocal) {
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
@ -168,9 +198,12 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future postEpisodeForInPatient(PostEpisodeForInpatientRequestModel postEpisodeForInpatientRequestModel) async {
|
|
|
|
Future postEpisodeForInPatient(
|
|
|
|
|
|
|
|
PostEpisodeForInpatientRequestModel
|
|
|
|
|
|
|
|
postEpisodeForInpatientRequestModel) async {
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
await _SOAPService.postEpisodeForInPatient(postEpisodeForInpatientRequestModel);
|
|
|
|
await _SOAPService.postEpisodeForInPatient(
|
|
|
|
|
|
|
|
postEpisodeForInpatientRequestModel);
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
error = _SOAPService.error;
|
|
|
|
error = _SOAPService.error;
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
@ -178,7 +211,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async {
|
|
|
|
Future postPhysicalExam(
|
|
|
|
|
|
|
|
PostPhysicalExamRequestModel postPhysicalExamRequestModel) async {
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel);
|
|
|
|
await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel);
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
@ -188,7 +222,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async {
|
|
|
|
Future postProgressNote(
|
|
|
|
|
|
|
|
PostProgressNoteRequestModel postProgressNoteRequestModel) async {
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
await _SOAPService.postProgressNote(postProgressNoteRequestModel);
|
|
|
|
await _SOAPService.postProgressNote(postProgressNoteRequestModel);
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
@ -198,7 +233,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async {
|
|
|
|
Future postAssessment(
|
|
|
|
|
|
|
|
PostAssessmentRequestModel postAssessmentRequestModel) async {
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
await _SOAPService.postAssessment(postAssessmentRequestModel);
|
|
|
|
await _SOAPService.postAssessment(postAssessmentRequestModel);
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
@ -208,7 +244,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future patchPhysicalExam(PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async {
|
|
|
|
Future patchPhysicalExam(
|
|
|
|
|
|
|
|
PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async {
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel);
|
|
|
|
await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel);
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
@ -218,7 +255,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async {
|
|
|
|
Future patchProgressNote(
|
|
|
|
|
|
|
|
PostProgressNoteRequestModel patchProgressNoteRequestModel) async {
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
await _SOAPService.patchProgressNote(patchProgressNoteRequestModel);
|
|
|
|
await _SOAPService.patchProgressNote(patchProgressNoteRequestModel);
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
@ -228,7 +266,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future patchAssessment(PostAssessmentRequestUpdateModel patchAssessmentRequestModel) async {
|
|
|
|
Future patchAssessment(
|
|
|
|
|
|
|
|
PostAssessmentRequestUpdateModel patchAssessmentRequestModel) async {
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
await _SOAPService.patchAssessment(patchAssessmentRequestModel!);
|
|
|
|
await _SOAPService.patchAssessment(patchAssessmentRequestModel!);
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
@ -238,7 +277,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP, {isLocalBusy = false}) async {
|
|
|
|
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP,
|
|
|
|
|
|
|
|
{isLocalBusy = false}) async {
|
|
|
|
if (isLocalBusy) {
|
|
|
|
if (isLocalBusy) {
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
@ -257,8 +297,14 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
String getAllergicNames(isArabic) {
|
|
|
|
String getAllergicNames(isArabic) {
|
|
|
|
String allergiesString = '';
|
|
|
|
String allergiesString = '';
|
|
|
|
patientAllergiesList.forEach((element) {
|
|
|
|
patientAllergiesList.forEach((element) {
|
|
|
|
MasterKeyModel? selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType!);
|
|
|
|
MasterKeyModel? selectedAllergy = getOneMasterKey(
|
|
|
|
if (selectedAllergy != null && element.isChecked!) allergiesString += ((isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , ');
|
|
|
|
masterKeys: MasterKeysService.Allergies,
|
|
|
|
|
|
|
|
id: element.allergyDiseaseId,
|
|
|
|
|
|
|
|
typeId: element.allergyDiseaseType!);
|
|
|
|
|
|
|
|
if (selectedAllergy != null && element.isChecked!)
|
|
|
|
|
|
|
|
allergiesString +=
|
|
|
|
|
|
|
|
((isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! +
|
|
|
|
|
|
|
|
' , ');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return allergiesString;
|
|
|
|
return allergiesString;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -266,7 +312,9 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
Future getPatientPhysicalExam(PatiantInformtion patientInfo) async {
|
|
|
|
Future getPatientPhysicalExam(PatiantInformtion patientInfo) async {
|
|
|
|
GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel(
|
|
|
|
GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel(
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
episodeID: patientInfo.episodeNo == null ? "0" : patientInfo.episodeNo.toString(),
|
|
|
|
episodeID: patientInfo.episodeNo == null
|
|
|
|
|
|
|
|
? "0"
|
|
|
|
|
|
|
|
: patientInfo.episodeNo.toString(),
|
|
|
|
appointmentNo: patientInfo.appointmentNo == null
|
|
|
|
appointmentNo: patientInfo.appointmentNo == null
|
|
|
|
? 0
|
|
|
|
? 0
|
|
|
|
: int.parse(
|
|
|
|
: int.parse(
|
|
|
|
@ -286,7 +334,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future getPatientProgressNote(GetProgressNoteReqModel getGetProgressNoteReqModel) async {
|
|
|
|
Future getPatientProgressNote(
|
|
|
|
|
|
|
|
GetProgressNoteReqModel getGetProgressNoteReqModel) async {
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel);
|
|
|
|
await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel);
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
@ -308,7 +357,11 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
|
|
|
|
|
|
|
Future getEpisodeForInpatient(PatiantInformtion patient) async {
|
|
|
|
Future getEpisodeForInpatient(PatiantInformtion patient) async {
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel(patientID: patient.patientId, admissionNo: int.parse(patient.admissionNo!), patientTypeID: 1);
|
|
|
|
GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel =
|
|
|
|
|
|
|
|
GetEpisodeForInpatientReqModel(
|
|
|
|
|
|
|
|
patientID: patient.patientId,
|
|
|
|
|
|
|
|
admissionNo: int.parse(patient.admissionNo!),
|
|
|
|
|
|
|
|
patientTypeID: 1);
|
|
|
|
await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel);
|
|
|
|
await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel);
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
error = _SOAPService.error;
|
|
|
|
error = _SOAPService.error;
|
|
|
|
@ -320,11 +373,13 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ignore: missing_return
|
|
|
|
// ignore: missing_return
|
|
|
|
MasterKeyModel? getOneMasterKey({required MasterKeysService masterKeys, dynamic id, int? typeId}) {
|
|
|
|
MasterKeyModel? getOneMasterKey(
|
|
|
|
|
|
|
|
{required MasterKeysService masterKeys, dynamic id, int? typeId}) {
|
|
|
|
switch (masterKeys) {
|
|
|
|
switch (masterKeys) {
|
|
|
|
case MasterKeysService.Allergies:
|
|
|
|
case MasterKeysService.Allergies:
|
|
|
|
List<MasterKeyModel> result = allergiesList.where((element) {
|
|
|
|
List<MasterKeyModel> result = allergiesList.where((element) {
|
|
|
|
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
return element.id == id &&
|
|
|
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
}).toList();
|
|
|
|
}).toList();
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
return result.first;
|
|
|
|
return result.first;
|
|
|
|
@ -333,7 +388,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
|
|
|
|
|
|
|
case MasterKeysService.HistoryFamily:
|
|
|
|
case MasterKeysService.HistoryFamily:
|
|
|
|
List<MasterKeyModel> result = historyFamilyList.where((element) {
|
|
|
|
List<MasterKeyModel> result = historyFamilyList.where((element) {
|
|
|
|
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
return element.id == id &&
|
|
|
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
}).toList();
|
|
|
|
}).toList();
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
return result.first;
|
|
|
|
return result.first;
|
|
|
|
@ -341,7 +397,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MasterKeysService.HistoryMedical:
|
|
|
|
case MasterKeysService.HistoryMedical:
|
|
|
|
List<MasterKeyModel> result = historyMedicalList.where((element) {
|
|
|
|
List<MasterKeyModel> result = historyMedicalList.where((element) {
|
|
|
|
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
return element.id == id &&
|
|
|
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
}).toList();
|
|
|
|
}).toList();
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
return result.first;
|
|
|
|
return result.first;
|
|
|
|
@ -349,7 +406,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MasterKeysService.HistorySocial:
|
|
|
|
case MasterKeysService.HistorySocial:
|
|
|
|
List<MasterKeyModel> result = historySocialList.where((element) {
|
|
|
|
List<MasterKeyModel> result = historySocialList.where((element) {
|
|
|
|
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
return element.id == id &&
|
|
|
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
}).toList();
|
|
|
|
}).toList();
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
return result.first;
|
|
|
|
return result.first;
|
|
|
|
@ -357,7 +415,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MasterKeysService.HistorySports:
|
|
|
|
case MasterKeysService.HistorySports:
|
|
|
|
List<MasterKeyModel> result = historySocialList.where((element) {
|
|
|
|
List<MasterKeyModel> result = historySocialList.where((element) {
|
|
|
|
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
return element.id == id &&
|
|
|
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
}).toList();
|
|
|
|
}).toList();
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
return result.first;
|
|
|
|
return result.first;
|
|
|
|
@ -373,7 +432,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MasterKeysService.PhysicalExamination:
|
|
|
|
case MasterKeysService.PhysicalExamination:
|
|
|
|
List<MasterKeyModel> result = physicalExaminationList.where((element) {
|
|
|
|
List<MasterKeyModel> result = physicalExaminationList.where((element) {
|
|
|
|
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
return element.id == id &&
|
|
|
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
}).toList();
|
|
|
|
}).toList();
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
return result.first;
|
|
|
|
return result.first;
|
|
|
|
@ -381,7 +441,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MasterKeysService.AllergySeverity:
|
|
|
|
case MasterKeysService.AllergySeverity:
|
|
|
|
List<MasterKeyModel> result = allergySeverityList.where((element) {
|
|
|
|
List<MasterKeyModel> result = allergySeverityList.where((element) {
|
|
|
|
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
return element.id == id &&
|
|
|
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
}).toList();
|
|
|
|
}).toList();
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
return result.first;
|
|
|
|
return result.first;
|
|
|
|
@ -389,7 +450,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MasterKeysService.DiagnosisType:
|
|
|
|
case MasterKeysService.DiagnosisType:
|
|
|
|
List<MasterKeyModel> result = listOfDiagnosisType.where((element) {
|
|
|
|
List<MasterKeyModel> result = listOfDiagnosisType.where((element) {
|
|
|
|
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
return element.id == id &&
|
|
|
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
}).toList();
|
|
|
|
}).toList();
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
return result.first;
|
|
|
|
return result.first;
|
|
|
|
@ -397,7 +459,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MasterKeysService.DiagnosisCondition:
|
|
|
|
case MasterKeysService.DiagnosisCondition:
|
|
|
|
List<MasterKeyModel> result = listOfDiagnosisCondition.where((element) {
|
|
|
|
List<MasterKeyModel> result = listOfDiagnosisCondition.where((element) {
|
|
|
|
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
return element.id == id &&
|
|
|
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
}).toList();
|
|
|
|
}).toList();
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
return result.first;
|
|
|
|
return result.first;
|
|
|
|
@ -436,8 +499,10 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int getFirstIndexForOldExamination(List<MySelectedExamination> mySelectedExamination) {
|
|
|
|
int getFirstIndexForOldExamination(
|
|
|
|
Iterable<MySelectedExamination> examList = mySelectedExamination.where((element) => !element.isLocal);
|
|
|
|
List<MySelectedExamination> mySelectedExamination) {
|
|
|
|
|
|
|
|
Iterable<MySelectedExamination> examList =
|
|
|
|
|
|
|
|
mySelectedExamination.where((element) => !element.isLocal);
|
|
|
|
|
|
|
|
|
|
|
|
if (examList.length > 0) {
|
|
|
|
if (examList.length > 0) {
|
|
|
|
return mySelectedExamination.indexOf(examList.first);
|
|
|
|
return mySelectedExamination.indexOf(examList.first);
|
|
|
|
@ -446,25 +511,44 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onUpdateSubjectStepStart(PatiantInformtion patientInfo) async {
|
|
|
|
onUpdateSubjectStepStart(PatiantInformtion patientInfo) async {
|
|
|
|
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
|
|
|
|
GetChiefComplaintReqModel getChiefComplaintReqModel =
|
|
|
|
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo!) : null,
|
|
|
|
GetChiefComplaintReqModel(
|
|
|
|
|
|
|
|
admissionNo:
|
|
|
|
|
|
|
|
patientInfo
|
|
|
|
|
|
|
|
.admissionNo !=
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
? int.parse(patientInfo.admissionNo!)
|
|
|
|
|
|
|
|
: null,
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
appointmentNo: patientInfo.appointmentNo != null ? int.parse(patientInfo.appointmentNo.toString()) : null,
|
|
|
|
appointmentNo: patientInfo.appointmentNo != null
|
|
|
|
|
|
|
|
? int.parse(patientInfo.appointmentNo.toString())
|
|
|
|
|
|
|
|
: null,
|
|
|
|
episodeId: patientInfo.episodeNo,
|
|
|
|
episodeId: patientInfo.episodeNo,
|
|
|
|
episodeID: patientInfo.episodeNo,
|
|
|
|
episodeID: patientInfo.episodeNo,
|
|
|
|
doctorID: '');
|
|
|
|
doctorID: '');
|
|
|
|
var services = [await _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel)];
|
|
|
|
var services = [
|
|
|
|
|
|
|
|
await _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel)
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
if (patientInfo.admissionNo == null) {
|
|
|
|
if (patientInfo.admissionNo == null) {
|
|
|
|
complaintsControllerError = '';
|
|
|
|
complaintsControllerError = '';
|
|
|
|
medicationControllerError = '';
|
|
|
|
medicationControllerError = '';
|
|
|
|
illnessControllerError = '';
|
|
|
|
illnessControllerError = '';
|
|
|
|
GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel(
|
|
|
|
GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel(
|
|
|
|
patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: '');
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
services.add(await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: true));
|
|
|
|
episodeID: patientInfo.episodeNo.toString(),
|
|
|
|
|
|
|
|
appointmentNo: int.parse(patientInfo.appointmentNo.toString()),
|
|
|
|
|
|
|
|
doctorID: '',
|
|
|
|
|
|
|
|
editedBy: '');
|
|
|
|
|
|
|
|
services.add(await _SOAPService.getPatientHistories(getHistoryReqModel,
|
|
|
|
|
|
|
|
isFirst: true));
|
|
|
|
|
|
|
|
|
|
|
|
GeneralGetReqForSOAP generalGetReqForSOAP =
|
|
|
|
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
|
|
|
|
GeneralGetReqForSOAP(patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: '');
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
|
|
|
|
episodeId: patientInfo.episodeNo,
|
|
|
|
|
|
|
|
appointmentNo: int.parse(patientInfo.appointmentNo.toString()),
|
|
|
|
|
|
|
|
doctorID: '',
|
|
|
|
|
|
|
|
editedBy: '');
|
|
|
|
|
|
|
|
|
|
|
|
services.add(await _SOAPService.getPatientAllergy(generalGetReqForSOAP));
|
|
|
|
services.add(await _SOAPService.getPatientAllergy(generalGetReqForSOAP));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -478,41 +562,61 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
if (patientHistoryList.isNotEmpty) {
|
|
|
|
if (patientHistoryList.isNotEmpty) {
|
|
|
|
if (historyFamilyList.isEmpty) {
|
|
|
|
if (historyFamilyList.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
services = [await _SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)];
|
|
|
|
services = [
|
|
|
|
|
|
|
|
await _SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)
|
|
|
|
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistoryFamily));
|
|
|
|
services.add(await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.HistoryFamily));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (historyMedicalList.isEmpty) {
|
|
|
|
if (historyMedicalList.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
services = [await _SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)];
|
|
|
|
services = [
|
|
|
|
|
|
|
|
await _SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)
|
|
|
|
|
|
|
|
];
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistoryMedical));
|
|
|
|
services.add(await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.HistoryMedical));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (historySurgicalList.length == 0) {
|
|
|
|
if (historySurgicalList.length == 0) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
services = [await _SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)];
|
|
|
|
services = [
|
|
|
|
|
|
|
|
await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.HistorySurgical)
|
|
|
|
|
|
|
|
];
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistorySurgical));
|
|
|
|
services.add(await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.HistorySurgical));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (historySportList.length == 0) {
|
|
|
|
if (historySportList.length == 0) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
services = [await _SOAPService.getMasterLookup(MasterKeysService.HistorySports)];
|
|
|
|
services = [
|
|
|
|
|
|
|
|
await _SOAPService.getMasterLookup(MasterKeysService.HistorySports)
|
|
|
|
|
|
|
|
];
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistorySports));
|
|
|
|
services.add(await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.HistorySports));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (patientAllergiesList.isNotEmpty) {
|
|
|
|
if (patientAllergiesList.isNotEmpty) {
|
|
|
|
if (allergiesList.isEmpty) if (services.isEmpty) {
|
|
|
|
if (allergiesList.isEmpty) if (services.isEmpty) {
|
|
|
|
services = [await _SOAPService.getMasterLookup(MasterKeysService.Allergies)];
|
|
|
|
services = [
|
|
|
|
|
|
|
|
await _SOAPService.getMasterLookup(MasterKeysService.Allergies)
|
|
|
|
|
|
|
|
];
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
services.add(await _SOAPService.getMasterLookup(MasterKeysService.Allergies));
|
|
|
|
services.add(
|
|
|
|
|
|
|
|
await _SOAPService.getMasterLookup(MasterKeysService.Allergies));
|
|
|
|
if (allergySeverityList.isEmpty) {
|
|
|
|
if (allergySeverityList.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
services = [await _SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)];
|
|
|
|
services = [
|
|
|
|
|
|
|
|
await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.AllergySeverity)
|
|
|
|
|
|
|
|
];
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
services.add(await _SOAPService.getMasterLookup(MasterKeysService.AllergySeverity));
|
|
|
|
services.add(await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.AllergySeverity));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -530,30 +634,45 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
List services = [];
|
|
|
|
List services = [];
|
|
|
|
if (medicationStrengthList.length == 0) {
|
|
|
|
if (medicationStrengthList.length == 0) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)];
|
|
|
|
services = [
|
|
|
|
|
|
|
|
await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.MedicationStrength)
|
|
|
|
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationStrength));
|
|
|
|
services.add(await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.MedicationStrength));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (medicationFrequencyList.length == 0) {
|
|
|
|
if (medicationFrequencyList.length == 0) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)];
|
|
|
|
services = [
|
|
|
|
|
|
|
|
await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.MedicationFrequency)
|
|
|
|
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency));
|
|
|
|
services.add(await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.MedicationFrequency));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (medicationDoseTimeList.length == 0) {
|
|
|
|
if (medicationDoseTimeList.length == 0) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)];
|
|
|
|
services = [
|
|
|
|
|
|
|
|
await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.MedicationDoseTime)
|
|
|
|
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime));
|
|
|
|
services.add(await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.MedicationDoseTime));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (medicationRouteList.length == 0) {
|
|
|
|
if (medicationRouteList.length == 0) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)];
|
|
|
|
services = [
|
|
|
|
|
|
|
|
await _SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)
|
|
|
|
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationRoute));
|
|
|
|
services.add(await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.MedicationRoute));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (allMedicationList!.isEmpty) {
|
|
|
|
if (allMedicationList!.isEmpty) {
|
|
|
|
@ -567,7 +686,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
final results = services;
|
|
|
|
final results = services;
|
|
|
|
|
|
|
|
|
|
|
|
if (_SOAPService.hasError || _prescriptionService.hasError) {
|
|
|
|
if (_SOAPService.hasError || _prescriptionService.hasError) {
|
|
|
|
error = _SOAPService.error.toString() + _prescriptionService.error.toString();
|
|
|
|
error =
|
|
|
|
|
|
|
|
_SOAPService.error.toString() + _prescriptionService.error.toString();
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
setState(
|
|
|
|
setState(
|
|
|
|
@ -576,28 +696,40 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
callAddAssessmentLookupsServices({String searchKey = "", bool allowSetState = true}) async {
|
|
|
|
callAddAssessmentLookupsServices(
|
|
|
|
|
|
|
|
{String searchKey = "", bool allowSetState = true}) async {
|
|
|
|
if (allowSetState) setState(ViewState.Busy);
|
|
|
|
if (allowSetState) setState(ViewState.Busy);
|
|
|
|
List services = [];
|
|
|
|
List services = [];
|
|
|
|
if (listOfDiagnosisCondition.isEmpty) {
|
|
|
|
if (listOfDiagnosisCondition.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
services = [await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)];
|
|
|
|
services = [
|
|
|
|
|
|
|
|
await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.DiagnosisCondition)
|
|
|
|
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
services.add(await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition));
|
|
|
|
services.add(await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.DiagnosisCondition));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (listOfDiagnosisType.length == 0) {
|
|
|
|
if (listOfDiagnosisType.length == 0) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
services = [await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)];
|
|
|
|
services = [
|
|
|
|
|
|
|
|
await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)
|
|
|
|
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
services.add(await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisType));
|
|
|
|
services.add(await _SOAPService.getMasterLookup(
|
|
|
|
|
|
|
|
MasterKeysService.DiagnosisType));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (listOfICD10.length == 0) {
|
|
|
|
if (listOfICD10.length == 0) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
if (services.isEmpty) {
|
|
|
|
services = [await _SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)];
|
|
|
|
services = [
|
|
|
|
|
|
|
|
await _SOAPService.getMasterLookup(MasterKeysService.ICD10,
|
|
|
|
|
|
|
|
searchKey: searchKey)
|
|
|
|
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
services.add(await _SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey));
|
|
|
|
services.add(await _SOAPService.getMasterLookup(MasterKeysService.ICD10,
|
|
|
|
|
|
|
|
searchKey: searchKey));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -613,9 +745,15 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
|
|
|
|
|
|
|
onUpdateAssessmentStepStart(PatiantInformtion patientInfo) async {
|
|
|
|
onUpdateAssessmentStepStart(PatiantInformtion patientInfo) async {
|
|
|
|
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
|
|
|
|
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
|
|
|
|
patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: int.parse(patientInfo.appointmentNo.toString()));
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
|
|
|
|
episodeID: patientInfo.episodeNo.toString(),
|
|
|
|
|
|
|
|
editedBy: '',
|
|
|
|
|
|
|
|
doctorID: '',
|
|
|
|
|
|
|
|
appointmentNo: int.parse(patientInfo.appointmentNo.toString()));
|
|
|
|
|
|
|
|
|
|
|
|
var services = [await _SOAPService.getPatientAssessment(getAssessmentReqModel)];
|
|
|
|
var services = [
|
|
|
|
|
|
|
|
await _SOAPService.getPatientAssessment(getAssessmentReqModel)
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
final results = services;
|
|
|
|
final results = services;
|
|
|
|
|
|
|
|
|
|
|
|
@ -630,8 +768,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future isPrescriptionOrderCreated(PatiantInformtion patientInfo) async {
|
|
|
|
Future isPrescriptionOrderCreated(PatiantInformtion patientInfo) async{
|
|
|
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
await _SOAPService.isPrescriptionOrderCreated(patientInfo);
|
|
|
|
await _SOAPService.isPrescriptionOrderCreated(patientInfo);
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
@ -641,32 +778,51 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
postSubjectServices(
|
|
|
|
postSubjectServices({patientInfo, String? complaintsText, String? medicationText, String? illnessText, List<MySelectedHistory>? myHistoryList, List<MySelectedAllergy>? myAllergiesList}) async {
|
|
|
|
{patientInfo,
|
|
|
|
|
|
|
|
String? complaintsText,
|
|
|
|
|
|
|
|
String? medicationText,
|
|
|
|
|
|
|
|
String? illnessText,
|
|
|
|
|
|
|
|
List<MySelectedHistory>? myHistoryList,
|
|
|
|
|
|
|
|
List<MySelectedAllergy>? myAllergiesList}) async {
|
|
|
|
List services = [];
|
|
|
|
List services = [];
|
|
|
|
|
|
|
|
|
|
|
|
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
|
|
|
|
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
|
|
|
|
createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText!, medicationText: medicationText!, complaintsText: complaintsText!);
|
|
|
|
createPostChiefComplaintRequestModel(
|
|
|
|
|
|
|
|
patientInfo: patientInfo,
|
|
|
|
|
|
|
|
illnessText: illnessText!,
|
|
|
|
|
|
|
|
medicationText: medicationText!,
|
|
|
|
|
|
|
|
complaintsText: complaintsText!);
|
|
|
|
if (patientChiefComplaintList.isEmpty) {
|
|
|
|
if (patientChiefComplaintList.isEmpty) {
|
|
|
|
postChiefComplaintRequestModel.editedBy = '';
|
|
|
|
postChiefComplaintRequestModel.editedBy = '';
|
|
|
|
services = [await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel)];
|
|
|
|
services = [
|
|
|
|
|
|
|
|
await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel)
|
|
|
|
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
postChiefComplaintRequestModel.editedBy = '';
|
|
|
|
postChiefComplaintRequestModel.editedBy = '';
|
|
|
|
services = [await _SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)];
|
|
|
|
services = [
|
|
|
|
|
|
|
|
await _SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)
|
|
|
|
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (myHistoryList!.length != 0) {
|
|
|
|
if (myHistoryList!.length != 0) {
|
|
|
|
PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList);
|
|
|
|
PostHistoriesRequestModel postHistoriesRequestModel =
|
|
|
|
|
|
|
|
createPostHistoriesRequestModel(
|
|
|
|
|
|
|
|
patientInfo: patientInfo, myHistoryList: myHistoryList);
|
|
|
|
|
|
|
|
|
|
|
|
if (patientHistoryList.isEmpty) {
|
|
|
|
if (patientHistoryList.isEmpty) {
|
|
|
|
services.add(await _SOAPService.postHistories(postHistoriesRequestModel));
|
|
|
|
services
|
|
|
|
|
|
|
|
.add(await _SOAPService.postHistories(postHistoriesRequestModel));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
services.add(await _SOAPService.patchHistories(postHistoriesRequestModel));
|
|
|
|
services
|
|
|
|
|
|
|
|
.add(await _SOAPService.patchHistories(postHistoriesRequestModel));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (myAllergiesList!.length != 0) {
|
|
|
|
if (myAllergiesList!.length != 0) {
|
|
|
|
PostAllergyRequestModel postAllergyRequestModel = createPostAllergyRequestModel(myAllergiesList: myAllergiesList, patientInfo: patientInfo);
|
|
|
|
PostAllergyRequestModel postAllergyRequestModel =
|
|
|
|
|
|
|
|
createPostAllergyRequestModel(
|
|
|
|
|
|
|
|
myAllergiesList: myAllergiesList, patientInfo: patientInfo);
|
|
|
|
if (patientAllergiesList.isEmpty) {
|
|
|
|
if (patientAllergiesList.isEmpty) {
|
|
|
|
services.add(await _SOAPService.postAllergy(postAllergyRequestModel));
|
|
|
|
services.add(await _SOAPService.postAllergy(postAllergyRequestModel));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -683,9 +839,15 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String? complaintsText, String? medicationText, String? illnessText}) {
|
|
|
|
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel(
|
|
|
|
|
|
|
|
{patientInfo,
|
|
|
|
|
|
|
|
String? complaintsText,
|
|
|
|
|
|
|
|
String? medicationText,
|
|
|
|
|
|
|
|
String? illnessText}) {
|
|
|
|
return PostChiefComplaintRequestModel(
|
|
|
|
return PostChiefComplaintRequestModel(
|
|
|
|
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
|
|
|
|
admissionNo: patientInfo.admissionNo != null
|
|
|
|
|
|
|
|
? int.parse(patientInfo.admissionNo)
|
|
|
|
|
|
|
|
: null,
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
episodeID: patientInfo.episodeNo ?? 0,
|
|
|
|
episodeID: patientInfo.episodeNo ?? 0,
|
|
|
|
appointmentNo: patientInfo.appointmentNo ?? 0,
|
|
|
|
appointmentNo: patientInfo.appointmentNo ?? 0,
|
|
|
|
@ -698,10 +860,13 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
numberOfWeeks: 0);
|
|
|
|
numberOfWeeks: 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List<MySelectedHistory>? myHistoryList}) {
|
|
|
|
PostHistoriesRequestModel createPostHistoriesRequestModel(
|
|
|
|
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: '');
|
|
|
|
{patientInfo, List<MySelectedHistory>? myHistoryList}) {
|
|
|
|
|
|
|
|
PostHistoriesRequestModel postHistoriesRequestModel =
|
|
|
|
|
|
|
|
new PostHistoriesRequestModel(doctorID: '');
|
|
|
|
myHistoryList!.forEach((history) {
|
|
|
|
myHistoryList!.forEach((history) {
|
|
|
|
if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = [];
|
|
|
|
if (postHistoriesRequestModel.listMedicalHistoryVM == null)
|
|
|
|
|
|
|
|
postHistoriesRequestModel.listMedicalHistoryVM = [];
|
|
|
|
postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM(
|
|
|
|
postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM(
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
episodeId: patientInfo.episodeNo,
|
|
|
|
episodeId: patientInfo.episodeNo,
|
|
|
|
@ -716,11 +881,16 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
return postHistoriesRequestModel;
|
|
|
|
return postHistoriesRequestModel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
PostAllergyRequestModel createPostAllergyRequestModel({myAllergiesList, patientInfo}) {
|
|
|
|
PostAllergyRequestModel createPostAllergyRequestModel(
|
|
|
|
PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel();
|
|
|
|
{myAllergiesList, patientInfo}) {
|
|
|
|
|
|
|
|
PostAllergyRequestModel postAllergyRequestModel =
|
|
|
|
|
|
|
|
new PostAllergyRequestModel();
|
|
|
|
myAllergiesList.forEach((allergy) {
|
|
|
|
myAllergiesList.forEach((allergy) {
|
|
|
|
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
|
|
|
|
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
|
|
|
|
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add(ListHisProgNotePatientAllergyDiseaseVM(
|
|
|
|
null)
|
|
|
|
|
|
|
|
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
|
|
|
|
|
|
|
|
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add(
|
|
|
|
|
|
|
|
ListHisProgNotePatientAllergyDiseaseVM(
|
|
|
|
allergyDiseaseId: allergy.selectedAllergy.id,
|
|
|
|
allergyDiseaseId: allergy.selectedAllergy.id,
|
|
|
|
allergyDiseaseType: allergy.selectedAllergy.typeId,
|
|
|
|
allergyDiseaseType: allergy.selectedAllergy.typeId,
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
@ -741,13 +911,30 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
|
|
|
|
|
|
|
/*vida plus */
|
|
|
|
/*vida plus */
|
|
|
|
|
|
|
|
|
|
|
|
getAllergiesVidaPlus(PatiantInformtion patientInfo) async{
|
|
|
|
getAllergiesVidaPlus(PatiantInformtion patientInfo) async {
|
|
|
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
|
|
|
await _SOAPService.patientAllergies(patientInfo);
|
|
|
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GeneralGetReqForSOAP generalGetReqForSOAP =
|
|
|
|
searchAllergies(String searchKey) async {
|
|
|
|
GeneralGetReqForSOAP(patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: '');
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
|
|
|
await _SOAPService.searchAllergies(searchKey);
|
|
|
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addAllergies(
|
|
|
|
|
|
|
|
AllergiesListVidaPlus request, PatiantInformtion patientInfo) async {
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
await _SOAPService.patientAllergies(generalGetReqForSOAP);
|
|
|
|
await _SOAPService.addAllergies(request, patientInfo);
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
error = _SOAPService.error;
|
|
|
|
error = _SOAPService.error;
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
@ -755,10 +942,60 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
resolveAllergies(
|
|
|
|
|
|
|
|
PatientAllergiesVidaPlus request, PatiantInformtion patientInfo) async {
|
|
|
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
|
|
|
await _SOAPService.resolveAllergies(request, patientInfo);
|
|
|
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
searchAllergies(String searchKey) async{
|
|
|
|
saveHopi(Map<String, dynamic> req, PatiantInformtion patientInfo) async {
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
await _SOAPService.searchAllergies(searchKey);
|
|
|
|
await _SOAPService.saveHopi(req, patientInfo);
|
|
|
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getHopi(PatiantInformtion patientInfo) async {
|
|
|
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
|
|
|
await _SOAPService.getHopi(patientInfo);
|
|
|
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getChiefComplaint(PatiantInformtion patientInfo) async {
|
|
|
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
|
|
|
await _SOAPService.getChiefComplaint(patientInfo);
|
|
|
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
searchChiefComplaint(PatiantInformtion patientInfo, String CC) async {
|
|
|
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
|
|
|
await _SOAPService.searchChiefComplaintVidaPlus(patientInfo, CC);
|
|
|
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
saveChiefComplaint(PatiantInformtion patientInfo, String CC) async {
|
|
|
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
|
|
|
await _SOAPService.postChiefComplaintVidaPlus(patientInfo, CC);
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
error = _SOAPService.error;
|
|
|
|
error = _SOAPService.error;
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|