|
|
|
|
@ -94,7 +94,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
List<GetAssessmentResModel> get patientAssessmentList =>
|
|
|
|
|
_SOAPService.patientAssessmentList;
|
|
|
|
|
|
|
|
|
|
int get episodeID => _SOAPService.episodeID;
|
|
|
|
|
int? get episodeID => _SOAPService.episodeID;
|
|
|
|
|
|
|
|
|
|
bool isAddProgress = true;
|
|
|
|
|
bool isAddExamInProgress = true;
|
|
|
|
|
@ -114,7 +114,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
List<GetMedicationResponseModel> get allMedicationList =>
|
|
|
|
|
_prescriptionService.allMedicationList;
|
|
|
|
|
|
|
|
|
|
SubjectiveCallBack subjectiveCallBack;
|
|
|
|
|
late SubjectiveCallBack subjectiveCallBack;
|
|
|
|
|
|
|
|
|
|
setSubjectiveCallBack(SubjectiveCallBack callBack) {
|
|
|
|
|
this.subjectiveCallBack = callBack;
|
|
|
|
|
@ -124,7 +124,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
subjectiveCallBack.nextFunction(model);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ObjectiveCallBack objectiveCallBack;
|
|
|
|
|
late ObjectiveCallBack objectiveCallBack;
|
|
|
|
|
|
|
|
|
|
setObjectiveCallBack(ObjectiveCallBack callBack) {
|
|
|
|
|
this.objectiveCallBack = callBack;
|
|
|
|
|
@ -134,7 +134,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
objectiveCallBack.nextFunction(model);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AssessmentCallBack assessmentCallBack;
|
|
|
|
|
late AssessmentCallBack assessmentCallBack;
|
|
|
|
|
|
|
|
|
|
setAssessmentCallBack(AssessmentCallBack callBack) {
|
|
|
|
|
this.assessmentCallBack = callBack;
|
|
|
|
|
@ -144,7 +144,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
assessmentCallBack.nextFunction(model);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PlanCallBack planCallBack;
|
|
|
|
|
late PlanCallBack planCallBack;
|
|
|
|
|
|
|
|
|
|
setPlanCallBack(PlanCallBack callBack) {
|
|
|
|
|
this.planCallBack = callBack;
|
|
|
|
|
@ -158,7 +158,8 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
await _SOAPService.getAllergies(getAllergiesRequestModel);
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
|
|
|
|
|
setState(ViewState.Error);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -172,7 +173,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
await _SOAPService.getMasterLookup(masterKeys);
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.Error);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -182,7 +183,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
await _SOAPService.postEpisode(postEpisodeReqModel);
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -195,7 +196,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
await _SOAPService.postEpisodeForInPatient(
|
|
|
|
|
postEpisodeForInpatientRequestModel);
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -206,7 +207,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel);
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -217,7 +218,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
await _SOAPService.postProgressNote(postProgressNoteRequestModel);
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -228,7 +229,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
await _SOAPService.postAssessment(postAssessmentRequestModel);
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -239,7 +240,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel);
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -250,7 +251,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
await _SOAPService.patchProgressNote(patchProgressNoteRequestModel);
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -261,7 +262,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
await _SOAPService.patchAssessment(patchAssessmentRequestModel);
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -275,7 +276,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
await _SOAPService.getPatientAllergy(generalGetReqForSOAP);
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
if (isLocalBusy) {
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
@ -287,21 +288,16 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
String getAllergicNames(isArabic) {
|
|
|
|
|
String allergiesString = '';
|
|
|
|
|
patientAllergiesList.forEach((element) {
|
|
|
|
|
MasterKeyModel selectedAllergy = getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.Allergies,
|
|
|
|
|
id: element.allergyDiseaseId,
|
|
|
|
|
typeId: element.allergyDiseaseType);
|
|
|
|
|
if (selectedAllergy != null && element.isChecked)
|
|
|
|
|
allergiesString +=
|
|
|
|
|
(isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) +
|
|
|
|
|
' , ';
|
|
|
|
|
MasterKeyModel? selectedAllergy = getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType);
|
|
|
|
|
if (selectedAllergy != null && element.isChecked!)
|
|
|
|
|
allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , ';
|
|
|
|
|
});
|
|
|
|
|
return allergiesString;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future getPatientPhysicalExam(
|
|
|
|
|
PatiantInformtion patientInfo,
|
|
|
|
|
Future getPatientPhysicalExam(PatiantInformtion patientInfo,
|
|
|
|
|
) async {
|
|
|
|
|
GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel(
|
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
|
@ -314,36 +310,34 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
patientInfo.appointmentNo.toString(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
if (patientInfo.admissionNo != null && patientInfo.admissionNo.isNotEmpty)
|
|
|
|
|
getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo);
|
|
|
|
|
if (patientInfo.admissionNo != null && patientInfo.admissionNo!.isNotEmpty)
|
|
|
|
|
getPhysicalExamReqModel.admissionNo = int.parse(patientInfo!.admissionNo!);
|
|
|
|
|
else
|
|
|
|
|
getPhysicalExamReqModel.admissionNo = 0;
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel);
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.Error);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future getPatientProgressNote(
|
|
|
|
|
GetGetProgressNoteReqModel getGetProgressNoteReqModel) async {
|
|
|
|
|
Future getPatientProgressNote(GetGetProgressNoteReqModel getGetProgressNoteReqModel) async {
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel);
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.Error);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future getPatientAssessment(
|
|
|
|
|
GetAssessmentReqModel getAssessmentReqModel) async {
|
|
|
|
|
Future getPatientAssessment(GetAssessmentReqModel getAssessmentReqModel) async {
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
await _SOAPService.getPatientAssessment(getAssessmentReqModel);
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.Error);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -353,7 +347,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
await _prescriptionService.getMedicationList();
|
|
|
|
|
if (_prescriptionService.hasError) {
|
|
|
|
|
error = _prescriptionService.error;
|
|
|
|
|
error = _prescriptionService.error!;
|
|
|
|
|
setState(ViewState.Error);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -364,11 +358,11 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel =
|
|
|
|
|
GetEpisodeForInpatientReqModel(
|
|
|
|
|
patientID: patient.patientId,
|
|
|
|
|
admissionNo: int.parse(patient.admissionNo),
|
|
|
|
|
admissionNo: int.parse(patient!.admissionNo!),
|
|
|
|
|
patientTypeID: 1);
|
|
|
|
|
await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel);
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else {
|
|
|
|
|
patient.episodeNo = _SOAPService.episodeID;
|
|
|
|
|
@ -377,13 +371,11 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ignore: missing_return
|
|
|
|
|
MasterKeyModel getOneMasterKey(
|
|
|
|
|
{@required MasterKeysService masterKeys, dynamic id, int typeId}) {
|
|
|
|
|
MasterKeyModel? getOneMasterKey({@required MasterKeysService? masterKeys, dynamic id, int? typeId}) {
|
|
|
|
|
switch (masterKeys) {
|
|
|
|
|
case MasterKeysService.Allergies:
|
|
|
|
|
List<MasterKeyModel> result = allergiesList.where((element) {
|
|
|
|
|
return element.id == id &&
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
|
return element.id == id && element.typeId == masterKeys!.getMasterKeyService();
|
|
|
|
|
}).toList();
|
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
|
return result.first;
|
|
|
|
|
@ -392,8 +384,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
|
|
|
|
|
case MasterKeysService.HistoryFamily:
|
|
|
|
|
List<MasterKeyModel> result = historyFamilyList.where((element) {
|
|
|
|
|
return element.id == id &&
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
|
return element.id == id && element.typeId == masterKeys!.getMasterKeyService();
|
|
|
|
|
}).toList();
|
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
|
return result.first;
|
|
|
|
|
@ -401,8 +392,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
break;
|
|
|
|
|
case MasterKeysService.HistoryMedical:
|
|
|
|
|
List<MasterKeyModel> result = historyMedicalList.where((element) {
|
|
|
|
|
return element.id == id &&
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
|
return element.id == id && element.typeId == masterKeys!.getMasterKeyService();
|
|
|
|
|
}).toList();
|
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
|
return result.first;
|
|
|
|
|
@ -410,8 +400,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
break;
|
|
|
|
|
case MasterKeysService.HistorySocial:
|
|
|
|
|
List<MasterKeyModel> result = historySocialList.where((element) {
|
|
|
|
|
return element.id == id &&
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
|
return element.id == id && element.typeId == masterKeys!.getMasterKeyService();
|
|
|
|
|
}).toList();
|
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
|
return result.first;
|
|
|
|
|
@ -419,8 +408,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
break;
|
|
|
|
|
case MasterKeysService.HistorySports:
|
|
|
|
|
List<MasterKeyModel> result = historySocialList.where((element) {
|
|
|
|
|
return element.id == id &&
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
|
return element.id == id && element.typeId == masterKeys!.getMasterKeyService();
|
|
|
|
|
}).toList();
|
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
|
return result.first;
|
|
|
|
|
@ -436,8 +424,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
break;
|
|
|
|
|
case MasterKeysService.PhysicalExamination:
|
|
|
|
|
List<MasterKeyModel> result = physicalExaminationList.where((element) {
|
|
|
|
|
return element.id == id &&
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
|
return element.id == id && element.typeId == masterKeys!.getMasterKeyService();
|
|
|
|
|
}).toList();
|
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
|
return result.first;
|
|
|
|
|
@ -445,8 +432,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
break;
|
|
|
|
|
case MasterKeysService.AllergySeverity:
|
|
|
|
|
List<MasterKeyModel> result = allergySeverityList.where((element) {
|
|
|
|
|
return element.id == id &&
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
|
return element.id == id && element.typeId == masterKeys!.getMasterKeyService();
|
|
|
|
|
}).toList();
|
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
|
return result.first;
|
|
|
|
|
@ -461,8 +447,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
|
|
|
|
|
case MasterKeysService.DiagnosisType:
|
|
|
|
|
List<MasterKeyModel> result = listOfDiagnosisType.where((element) {
|
|
|
|
|
return element.id == id &&
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
|
return element.id == id && element.typeId == masterKeys!.getMasterKeyService();
|
|
|
|
|
}).toList();
|
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
|
return result.first;
|
|
|
|
|
@ -470,8 +455,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
break;
|
|
|
|
|
case MasterKeysService.DiagnosisCondition:
|
|
|
|
|
List<MasterKeyModel> result = listOfDiagnosisCondition.where((element) {
|
|
|
|
|
return element.id == id &&
|
|
|
|
|
element.typeId == masterKeys.getMasterKeyService();
|
|
|
|
|
return element.id == id && element.typeId == masterKeys!.getMasterKeyService();
|
|
|
|
|
}).toList();
|
|
|
|
|
if (result.isNotEmpty) {
|
|
|
|
|
return result.first;
|
|
|
|
|
@ -504,10 +488,9 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
GetChiefComplaintReqModel getChiefComplaintReqModel =
|
|
|
|
|
GetChiefComplaintReqModel(
|
|
|
|
|
admissionNo:
|
|
|
|
|
patientInfo
|
|
|
|
|
.admissionNo !=
|
|
|
|
|
patientInfo!.admissionNo !=
|
|
|
|
|
null
|
|
|
|
|
? int.parse(patientInfo.admissionNo)
|
|
|
|
|
? int.parse(patientInfo!.admissionNo!)
|
|
|
|
|
: null,
|
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
|
appointmentNo: patientInfo.appointmentNo != null
|
|
|
|
|
@ -608,7 +591,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
final results = await Future.wait(services ?? []);
|
|
|
|
|
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.Error);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -668,7 +651,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
final results = await Future.wait(services ?? []);
|
|
|
|
|
|
|
|
|
|
if (_SOAPService.hasError || _prescriptionService.hasError) {
|
|
|
|
|
error = _SOAPService.error + _prescriptionService.error;
|
|
|
|
|
error = _SOAPService.error + _prescriptionService.error!;
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -708,7 +691,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
final results = await Future.wait(services ?? []);
|
|
|
|
|
if (allowSetState) {
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -732,7 +715,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -740,11 +723,11 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
|
|
|
|
|
postSubjectServices(
|
|
|
|
|
{patientInfo,
|
|
|
|
|
String complaintsText,
|
|
|
|
|
String medicationText,
|
|
|
|
|
String illnessText,
|
|
|
|
|
List<MySelectedHistory> myHistoryList,
|
|
|
|
|
List<MySelectedAllergy> myAllergiesList}) async {
|
|
|
|
|
required String complaintsText,
|
|
|
|
|
required String medicationText,
|
|
|
|
|
required String illnessText,
|
|
|
|
|
required List<MySelectedHistory> myHistoryList,
|
|
|
|
|
required List<MySelectedAllergy> myAllergiesList}) async {
|
|
|
|
|
var services;
|
|
|
|
|
|
|
|
|
|
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
|
|
|
|
|
@ -790,7 +773,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
final results = await Future.wait(services);
|
|
|
|
|
|
|
|
|
|
if (_SOAPService.hasError) {
|
|
|
|
|
error = _SOAPService.error;
|
|
|
|
|
error = _SOAPService.error!;
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
@ -798,9 +781,9 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
|
|
|
|
|
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel(
|
|
|
|
|
{patientInfo,
|
|
|
|
|
String complaintsText,
|
|
|
|
|
String medicationText,
|
|
|
|
|
String illnessText}) {
|
|
|
|
|
required String complaintsText,
|
|
|
|
|
required String medicationText,
|
|
|
|
|
required String illnessText}) {
|
|
|
|
|
return new PostChiefComplaintRequestModel(
|
|
|
|
|
admissionNo: patientInfo.admissionNo != null
|
|
|
|
|
? int.parse(patientInfo.admissionNo)
|
|
|
|
|
@ -818,13 +801,13 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PostHistoriesRequestModel createPostHistoriesRequestModel(
|
|
|
|
|
{patientInfo, List<MySelectedHistory> myHistoryList}) {
|
|
|
|
|
{patientInfo, required List<MySelectedHistory> myHistoryList}) {
|
|
|
|
|
PostHistoriesRequestModel postHistoriesRequestModel =
|
|
|
|
|
new PostHistoriesRequestModel(doctorID: '');
|
|
|
|
|
myHistoryList.forEach((history) {
|
|
|
|
|
if (postHistoriesRequestModel.listMedicalHistoryVM == null)
|
|
|
|
|
postHistoriesRequestModel.listMedicalHistoryVM = [];
|
|
|
|
|
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
|
|
|
|
|
postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM(
|
|
|
|
|
patientMRN: patientInfo.patientMRN,
|
|
|
|
|
episodeId: patientInfo.episodeNo,
|
|
|
|
|
appointmentNo: patientInfo.appointmentNo,
|
|
|
|
|
@ -846,7 +829,7 @@ class SOAPViewModel extends BaseViewModel {
|
|
|
|
|
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
|
|
|
|
|
null)
|
|
|
|
|
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
|
|
|
|
|
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(
|
|
|
|
|
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add(
|
|
|
|
|
ListHisProgNotePatientAllergyDiseaseVM(
|
|
|
|
|
allergyDiseaseId: allergy.selectedAllergy.id,
|
|
|
|
|
allergyDiseaseType: allergy.selectedAllergy.typeId,
|
|
|
|
|
|