add assessment updated

development-3.3_voipCall
haroon amjad 2 years ago
parent 5e63db7ea6
commit 793f9ff905

@ -45,52 +45,39 @@ class SOAPViewModel extends BaseViewModel {
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 historyMedicalList =>
_SOAPService.historyMedicalList;
List<MasterKeyModel> get historyMedicalList => _SOAPService.historyMedicalList;
List<MasterKeyModel> get historySportList => _SOAPService.historySportList;
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<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;
int get episodeID => _SOAPService.episodeID;
@ -109,8 +96,7 @@ class SOAPViewModel extends BaseViewModel {
get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel;
List<GetMedicationResponseModel> get allMedicationList =>
_prescriptionService.allMedicationList;
List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList;
SubjectiveCallBack subjectiveCallBack;
@ -151,8 +137,8 @@ class SOAPViewModel extends BaseViewModel {
nextOnPlanPage(model) {
planCallBack.nextFunction(model);
}
Future getMasterLookup(MasterKeysService masterKeys,
{bool isBusyLocal = false, String searchKey = ""}) async {
Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false, String searchKey = ""}) async {
if (isBusyLocal) {
setState(ViewState.Busy);
} else
@ -175,12 +161,9 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postEpisodeForInPatient(
PostEpisodeForInpatientRequestModel
postEpisodeForInpatientRequestModel) async {
Future postEpisodeForInPatient(PostEpisodeForInpatientRequestModel postEpisodeForInpatientRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postEpisodeForInPatient(
postEpisodeForInpatientRequestModel);
await _SOAPService.postEpisodeForInPatient(postEpisodeForInpatientRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
@ -188,8 +171,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postPhysicalExam(
PostPhysicalExamRequestModel postPhysicalExamRequestModel) async {
Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel);
if (_SOAPService.hasError) {
@ -199,8 +181,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postProgressNote(
PostProgressNoteRequestModel postProgressNoteRequestModel) async {
Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postProgressNote(postProgressNoteRequestModel);
if (_SOAPService.hasError) {
@ -210,8 +191,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postAssessment(
PostAssessmentRequestModel postAssessmentRequestModel) async {
Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postAssessment(postAssessmentRequestModel);
if (_SOAPService.hasError) {
@ -221,8 +201,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future patchPhysicalExam(
PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async {
Future patchPhysicalExam(PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel);
if (_SOAPService.hasError) {
@ -232,8 +211,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future patchProgressNote(
PostProgressNoteRequestModel patchProgressNoteRequestModel) async {
Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.patchProgressNote(patchProgressNoteRequestModel);
if (_SOAPService.hasError) {
@ -243,8 +221,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future patchAssessment(
PatchAssessmentReqModel patchAssessmentRequestModel) async {
Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.patchAssessment(patchAssessmentRequestModel);
if (_SOAPService.hasError) {
@ -254,8 +231,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP,
{isLocalBusy = false}) async {
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP, {isLocalBusy = false}) async {
if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else
@ -274,14 +250,8 @@ 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;
}
@ -291,9 +261,7 @@ class SOAPViewModel extends BaseViewModel {
) async {
GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel(
patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo == null
? "0"
: patientInfo.episodeNo.toString(),
episodeID: patientInfo.episodeNo == null ? "0" : patientInfo.episodeNo.toString(),
appointmentNo: patientInfo.appointmentNo == null
? 0
: int.parse(
@ -313,8 +281,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getPatientProgressNote(
GetProgressNoteReqModel getGetProgressNoteReqModel) async {
Future getPatientProgressNote(GetProgressNoteReqModel getGetProgressNoteReqModel) async {
setState(ViewState.Busy);
await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel);
if (_SOAPService.hasError) {
@ -324,7 +291,6 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getMedicationList() async {
setState(ViewState.Busy);
await _prescriptionService.getMedicationList();
@ -337,11 +303,7 @@ class SOAPViewModel extends BaseViewModel {
Future getEpisodeForInpatient(PatiantInformtion patient) async {
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);
if (_SOAPService.hasError) {
error = _SOAPService.error;
@ -353,13 +315,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;
@ -368,8 +328,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;
@ -377,8 +336,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;
@ -386,8 +344,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;
@ -395,8 +352,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;
@ -412,8 +368,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;
@ -421,8 +376,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;
@ -430,8 +384,7 @@ class SOAPViewModel extends BaseViewModel {
break;
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;
@ -439,8 +392,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;
@ -458,10 +410,8 @@ class SOAPViewModel extends BaseViewModel {
}
}
int getFirstIndexForOldExamination(
List<MySelectedExamination> mySelectedExamination) {
Iterable<MySelectedExamination> examList =
mySelectedExamination.where((element) => !element.isLocal);
int getFirstIndexForOldExamination(List<MySelectedExamination> mySelectedExamination) {
Iterable<MySelectedExamination> examList = mySelectedExamination.where((element) => !element.isLocal);
if (examList.length > 0) {
return mySelectedExamination.indexOf(examList.first);
@ -470,44 +420,25 @@ class SOAPViewModel extends BaseViewModel {
}
onUpdateSubjectStepStart(PatiantInformtion patientInfo) async {
GetChiefComplaintReqModel getChiefComplaintReqModel =
GetChiefComplaintReqModel(
admissionNo:
patientInfo
.admissionNo !=
null
? int.parse(patientInfo.admissionNo)
: null,
patientMRN: patientInfo.patientMRN,
appointmentNo: patientInfo.appointmentNo != null
? int.parse(patientInfo.appointmentNo.toString())
: null,
episodeId: patientInfo.episodeNo,
episodeID: patientInfo.episodeNo,
doctorID: '');
var services = [
_SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel)
];
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
patientMRN: patientInfo.patientMRN,
appointmentNo: patientInfo.appointmentNo != null ? int.parse(patientInfo.appointmentNo.toString()) : null,
episodeId: patientInfo.episodeNo,
episodeID: patientInfo.episodeNo,
doctorID: '');
var services = [_SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel)];
if (patientInfo.admissionNo == null) {
complaintsControllerError = '';
medicationControllerError = '';
illnessControllerError = '';
GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel(
patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo.toString(),
appointmentNo: int.parse(patientInfo.appointmentNo.toString()),
doctorID: '',
editedBy: '');
services.add(
_SOAPService.getPatientHistories(getHistoryReqModel, isFirst: true));
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo,
appointmentNo: int.parse(patientInfo.appointmentNo.toString()),
doctorID: '',
editedBy: '');
patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: '');
services.add(_SOAPService.getPatientHistories(getHistoryReqModel, isFirst: true));
GeneralGetReqForSOAP generalGetReqForSOAP =
GeneralGetReqForSOAP(patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: '');
services.add(_SOAPService.getPatientAllergy(generalGetReqForSOAP));
}
@ -521,40 +452,28 @@ class SOAPViewModel extends BaseViewModel {
if (patientHistoryList.isNotEmpty) {
if (historyFamilyList.isEmpty) {
if (services == null) {
services = [
_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)
];
services = [_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)];
} else {
services.add(
_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily));
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily));
}
}
if (historyMedicalList.isEmpty) {
if (services == null) {
services = [
_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)
];
services = [_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)];
} else
services.add(
_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical));
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical));
}
if (historySurgicalList.length == 0) {
if (services == null) {
services = [
_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)
];
services = [_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)];
} else
services.add(
_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical));
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical));
}
if (historySportList.length == 0) {
if (services == null) {
services = [
_SOAPService.getMasterLookup(MasterKeysService.HistorySports)
];
services = [_SOAPService.getMasterLookup(MasterKeysService.HistorySports)];
} else
services.add(
_SOAPService.getMasterLookup(MasterKeysService.HistorySports));
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistorySports));
}
}
@ -565,12 +484,9 @@ class SOAPViewModel extends BaseViewModel {
services.add(_SOAPService.getMasterLookup(MasterKeysService.Allergies));
if (allergySeverityList.isEmpty) {
if (services == null) {
services = [
_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)
];
services = [_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)];
} else
services.add(
_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity));
services.add(_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity));
}
}
@ -588,42 +504,30 @@ class SOAPViewModel extends BaseViewModel {
var services;
if (medicationStrengthList.length == 0) {
if (services == null) {
services = [
_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)
];
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)];
} else {
services.add(
_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength));
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength));
}
}
if (medicationFrequencyList.length == 0) {
if (services == null) {
services = [
_SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)
];
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)];
} else {
services.add(_SOAPService.getMasterLookup(
MasterKeysService.MedicationFrequency));
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency));
}
}
if (medicationDoseTimeList.length == 0) {
if (services == null) {
services = [
_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)
];
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)];
} else {
services.add(
_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime));
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime));
}
}
if (medicationRouteList.length == 0) {
if (services == null) {
services = [
_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)
];
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)];
} else {
services.add(
_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute));
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute));
}
}
if (allMedicationList.length == 0) {
@ -643,34 +547,28 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
callAddAssessmentLookupsServices({bool allowSetState = true}) async {
callAddAssessmentLookupsServices({String searchKey = "", bool allowSetState = true}) async {
if (allowSetState) setState(ViewState.Busy);
var services;
if (listOfDiagnosisCondition.length == 0) {
if (services == null) {
services = [
_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)
];
services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)];
} else {
services.add(
_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition));
services.add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition));
}
}
if (listOfDiagnosisType.length == 0) {
if (services == null) {
services = [
_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)
];
services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)];
} else {
services
.add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType));
services.add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType));
}
}
if (listOfICD10.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10)];
services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.ICD10));
services.add(_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey));
}
}
@ -686,11 +584,7 @@ class SOAPViewModel extends BaseViewModel {
onUpdateAssessmentStepStart(PatiantInformtion patientInfo) async {
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 = [_SOAPService.getPatientAssessment(getAssessmentReqModel)];
@ -707,37 +601,21 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
postSubjectServices(
{patientInfo,
String complaintsText,
String medicationText,
String illnessText,
List<MySelectedHistory> myHistoryList,
List<MySelectedAllergy> myAllergiesList}) async {
postSubjectServices({patientInfo, String complaintsText, String medicationText, String illnessText, List<MySelectedHistory> myHistoryList, List<MySelectedAllergy> myAllergiesList}) async {
var services;
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
createPostChiefComplaintRequestModel(
patientInfo: patientInfo,
illnessText: illnessText,
medicationText: medicationText,
complaintsText: complaintsText);
createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText, medicationText: medicationText, complaintsText: complaintsText);
if (patientChiefComplaintList.isEmpty) {
postChiefComplaintRequestModel.editedBy = '';
services = [
_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)
];
services = [_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)];
} else {
postChiefComplaintRequestModel.editedBy = '';
services = [
_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)
];
services = [_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)];
}
if (myHistoryList.length != 0) {
PostHistoriesRequestModel postHistoriesRequestModel =
createPostHistoriesRequestModel(
patientInfo: patientInfo, myHistoryList: myHistoryList);
PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList);
if (patientHistoryList.isEmpty) {
services.add(_SOAPService.postHistories(postHistoriesRequestModel));
@ -747,9 +625,7 @@ class SOAPViewModel extends BaseViewModel {
}
if (myAllergiesList.length != 0) {
PostAllergyRequestModel postAllergyRequestModel =
createPostAllergyRequestModel(
myAllergiesList: myAllergiesList, patientInfo: patientInfo);
PostAllergyRequestModel postAllergyRequestModel = createPostAllergyRequestModel(myAllergiesList: myAllergiesList, patientInfo: patientInfo);
if (patientAllergiesList.isEmpty) {
services.add(_SOAPService.postAllergy(postAllergyRequestModel));
} else {
@ -766,15 +642,9 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel(
{patientInfo,
String complaintsText,
String medicationText,
String illnessText}) {
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String complaintsText, String medicationText, String illnessText}) {
return new PostChiefComplaintRequestModel(
admissionNo: patientInfo.admissionNo != null
? int.parse(patientInfo.admissionNo)
: null,
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo ?? 0,
appointmentNo: patientInfo.appointmentNo ?? 0,
@ -787,13 +657,10 @@ class SOAPViewModel extends BaseViewModel {
numberOfWeeks: 0);
}
PostHistoriesRequestModel createPostHistoriesRequestModel(
{patientInfo, List<MySelectedHistory> myHistoryList}) {
PostHistoriesRequestModel postHistoriesRequestModel =
new PostHistoriesRequestModel(doctorID: '');
PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List<MySelectedHistory> myHistoryList}) {
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: '');
myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null)
postHistoriesRequestModel.listMedicalHistoryVM = [];
if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = [];
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo,
@ -808,29 +675,24 @@ class SOAPViewModel extends BaseViewModel {
return postHistoriesRequestModel;
}
PostAllergyRequestModel createPostAllergyRequestModel(
{myAllergiesList, patientInfo}) {
PostAllergyRequestModel postAllergyRequestModel =
new PostAllergyRequestModel();
PostAllergyRequestModel createPostAllergyRequestModel({myAllergiesList, patientInfo}) {
PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel();
myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(
ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo,
appointmentNo: patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: allergy.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
isChecked: allergy.isChecked,
isUpdatedByNurse: false));
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo,
appointmentNo: patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: allergy.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
isChecked: allergy.isChecked,
isUpdatedByNurse: false));
});
return postAllergyRequestModel;

@ -266,7 +266,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
if (patient.episodeNo != 0)
AppButton(
loading: model.state == ViewState.BusyLocal,
disabled: model.state == ViewState.BusyLocal || isSigned,
// disabled: model.state == ViewState.BusyLocal || isSigned,
title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}",
color: ((isInpatient) || isFromLiveCare) && model.state != ViewState.BusyLocal
? AppGlobal.appRedColor

@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
@ -28,18 +29,11 @@ import 'package:provider/provider.dart';
class AddAssessmentDetails extends StatefulWidget {
final MySelectedAssessment mySelectedAssessment;
final List<MySelectedAssessment> mySelectedAssessmentList;
final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate)
addSelectedAssessment;
final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment;
final PatiantInformtion patientInfo;
final bool isUpdate;
AddAssessmentDetails(
{Key key,
this.mySelectedAssessment,
this.addSelectedAssessment,
this.patientInfo,
this.isUpdate = false,
this.mySelectedAssessmentList});
AddAssessmentDetails({Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList});
@override
_AddAssessmentDetailsState createState() => _AddAssessmentDetailsState();
@ -60,48 +54,28 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
ProjectViewModel projectViewModel = Provider.of(context);
remarkController.text = widget.mySelectedAssessment.remark ?? "";
appointmentIdController.text =
widget.mySelectedAssessment.appointmentId.toString();
appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString();
if (widget.isUpdate) {
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null)
conditionController.text = projectViewModel.isArabic
? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr
: widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn;
conditionController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn;
if (widget.mySelectedAssessment.selectedDiagnosisType != null)
typeController.text = projectViewModel.isArabic
? widget.mySelectedAssessment.selectedDiagnosisType.nameAr
: widget.mySelectedAssessment.selectedDiagnosisType.nameEn;
if (widget.mySelectedAssessment.selectedICD != null)
icdNameController.text = widget.mySelectedAssessment.selectedICD.code;
typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr : widget.mySelectedAssessment.selectedDiagnosisType.nameEn;
if (widget.mySelectedAssessment.selectedICD != null) icdNameController.text = widget.mySelectedAssessment.selectedICD.code;
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{IconData icon, String validationError}) {
InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData icon, String validationError}) {
return new InputDecoration(
fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: (validationError != null
? Colors.red.shade700
: Color(0xFFEFEFEF)),
width: 2.5),
borderSide: BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: (validationError != null
? Colors.red.shade700
: Color(0xFFEFEFEF)),
width: 2.5),
borderSide: BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: (validationError != null
? Colors.red.shade700
: Color(0xFFEFEFEF)),
width: 2.5),
borderSide: BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
@ -118,13 +92,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
heightFactor: 1,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
model.callAddAssessmentLookupsServices();
// model.callAddAssessmentLookupsServices();
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addAssessmentDetails),
appBar: BottomSheetTitle(title: TranslationBase.of(context).addAssessmentDetails),
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView(
child: Center(
@ -133,263 +106,229 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
FractionallySizedBox(
widthFactor: 0.9,
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom(
// height: 55.0,
height: Utils.getTextFieldHeight(),
hintText:
TranslationBase.of(context).appointmentNumber,
isTextFieldHasSuffix: false,
enabled: false,
controller: appointmentIdController,
),
),
SizedBox(
height: 10,
),
Container(
child: InkWell(
onTap: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment
.selectedICD = null;
icdNameController.text = null;
});
}
: null,
child: widget
.mySelectedAssessment.selectedICD ==
null
? CustomAutoCompleteTextField(
isShowError: isFormSubmitted &&
widget.mySelectedAssessment
.selectedICD ==
null,
child: AutoCompleteTextField<
MasterKeyModel>(
decoration: TextFieldsUtils
.textFieldSelectorDecoration(
TranslationBase.of(context)
.nameOrICD,
null,
true,
suffixIcon: Icons.search),
itemSubmitted: (item) => setState(() {
widget.mySelectedAssessment
.selectedICD = item;
icdNameController.text =
'${item.code.trim()}/${item.description}';
}),
key: key,
suggestions: model.listOfICD10,
itemBuilder: (context, suggestion) =>
new Padding(
child: AppText(
suggestion.description +
" / " +
suggestion.code
.toString()),
padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.description
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
suggestion.description
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
suggestion.code
.toLowerCase()
.startsWith(
input.toLowerCase()),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
SizedBox(
height: 16,
),
Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom(
// height: 55.0,
height: Utils.getTextFieldHeight(),
hintText: TranslationBase.of(context).appointmentNumber,
isTextFieldHasSuffix: false,
enabled: false,
controller: appointmentIdController,
),
),
SizedBox(
height: 10,
),
Container(
child: InkWell(
onTap: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment.selectedICD = null;
icdNameController.text = null;
});
}
: null,
child: widget.mySelectedAssessment.selectedICD == null
? CustomAutoCompleteTextField(
isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
flex: 4,
child: AutoCompleteTextField<MasterKeyModel>(
decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null),
controller: icdNameController,
itemSubmitted: (item) => setState(() {
widget.mySelectedAssessment.selectedICD = item;
icdNameController.text = '${item.code.trim()}/${item.description}';
}),
key: key,
suggestions: model.listOfICD10,
itemBuilder: (context, suggestion) =>
new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString()), padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
// suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// suggestion.code.toLowerCase().startsWith(input.toLowerCase()),
suggestion.description.toLowerCase().contains(input.toLowerCase()) ||
// suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
suggestion.code.toLowerCase().contains(input.toLowerCase()),
),
),
)
: AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment
.selectedICD = null;
icdNameController.text = null;
});
Expanded(
child: IconButton(
onPressed: () {
print(icdNameController.text);
if (icdNameController.text.length <= 3) {
DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
} else {
model.listOfICD10.clear();
model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
}
: null,
hintText: TranslationBase.of(context)
.nameOrICD,
maxLines: 1,
minLines: 1,
controller: icdNameController,
enabled: true,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
},
icon: Icon(Icons.search),
),
),
],
),
)
: AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment.selectedICD = null;
icdNameController.text = null;
});
}
: null,
hintText: TranslationBase.of(context).nameOrICD,
maxLines: 1,
minLines: 1,
controller: icdNameController,
enabled: true,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
onPressed: () {
print(icdNameController.text);
if (icdNameController.text.length <= 3) {
DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
} else {
model.listOfICD10.clear();
model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
}
},
icon: Icon(
Icons.search,
color: Colors.grey.shade600,
)),
)),
),
if (widget.mySelectedAssessment.selectedICD != null)
Column(
children: [
SizedBox(
height: 3,
),
Container(
width:
MediaQuery.of(context).size.width * 0.7,
child: AppText(
widget.mySelectedAssessment.selectedICD
.description +
(' (${widget.mySelectedAssessment.selectedICD.code} )'),
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
),
),
],
)),
),
if (widget.mySelectedAssessment.selectedICD != null)
Column(
children: [
SizedBox(
height: 3,
),
SizedBox(
height: 7,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfDiagnosisCondition != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment
.selectedDiagnosisCondition,
okFunction:
(MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment
.selectedDiagnosisCondition =
selectedValue;
conditionController
.text = projectViewModel
.isArabic
? widget
.mySelectedAssessment
.selectedDiagnosisCondition
.nameAr
: widget
.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText: TranslationBase.of(context).condition,
maxLines: 1,
minLines: 1,
controller: conditionController,
isTextFieldHasSuffix: true,
enabled: false,
hasBorder: true,
validationError: isFormSubmitted &&
widget.mySelectedAssessment
.selectedDiagnosisCondition ==
null
? TranslationBase.of(context).emptyMessage
: null,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfDiagnosisType != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment
.selectedDiagnosisType,
okFunction:
(MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment
.selectedDiagnosisType =
selectedValue;
typeController.text =
projectViewModel.isArabic
? selectedValue.nameAr
: selectedValue.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText: TranslationBase.of(context).dType,
maxLines: 1,
minLines: 1,
enabled: false,
isTextFieldHasSuffix: true,
controller: typeController,
hasBorder: true,
validationError: isFormSubmitted &&
widget.mySelectedAssessment
.selectedDiagnosisType ==
null
? TranslationBase.of(context).emptyMessage
: null,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).remarks,
maxLines: 18,
minLines: 5,
inputType: TextInputType.multiline,
controller: remarkController,
onChanged: (value) {
widget.mySelectedAssessment.remark =
remarkController.text;
},
Container(
width: MediaQuery.of(context).size.width * 0.7,
child: AppText(
widget.mySelectedAssessment.selectedICD.description + (' (${widget.mySelectedAssessment.selectedICD.code} )'),
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
),
),
),
SizedBox(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort
? 20
: SizeConfig.isHeightShort
? 15
: 10),
),
])),
],
),
SizedBox(
height: 7,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfDiagnosisCondition != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition,
okFunction: (MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue;
conditionController.text =
projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText: TranslationBase.of(context).condition,
maxLines: 1,
minLines: 1,
controller: conditionController,
isTextFieldHasSuffix: true,
enabled: false,
hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : null,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfDiagnosisType != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisType,
okFunction: (MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment.selectedDiagnosisType = selectedValue;
typeController.text = projectViewModel.isArabic ? selectedValue.nameAr : selectedValue.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText: TranslationBase.of(context).dType,
maxLines: 1,
minLines: 1,
enabled: false,
isTextFieldHasSuffix: true,
controller: typeController,
hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : null,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).remarks,
maxLines: 18,
minLines: 5,
inputType: TextInputType.multiline,
controller: remarkController,
onChanged: (value) {
widget.mySelectedAssessment.remark = remarkController.text;
},
),
),
SizedBox(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort
? 20
: SizeConfig.isHeightShort
? 15
: 10),
),
])),
),
],
),
@ -400,26 +339,17 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
height: 0,
)
: CustomBottomSheetContainer(
label: (widget.isUpdate
? 'Update Assessment Details'
: 'Add Assessment Details'),
label: (widget.isUpdate ? 'Update Assessment Details' : 'Add Assessment Details'),
onTap: () async {
setState(() {
isFormSubmitted = true;
});
widget.mySelectedAssessment.remark = remarkController.text;
widget.mySelectedAssessment.appointmentId =
int.parse(appointmentIdController.text);
if (widget.mySelectedAssessment
.selectedDiagnosisCondition !=
null &&
widget.mySelectedAssessment.selectedDiagnosisType !=
null &&
widget.mySelectedAssessment.appointmentId = int.parse(appointmentIdController.text);
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null &&
widget.mySelectedAssessment.selectedDiagnosisType != null &&
widget.mySelectedAssessment.selectedICD != null) {
await submitAssessment(
isUpdate: widget.isUpdate,
model: model,
mySelectedAssessment: widget.mySelectedAssessment);
await submitAssessment(isUpdate: widget.isUpdate, model: model, mySelectedAssessment: widget.mySelectedAssessment);
}
},
),
@ -428,10 +358,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
);
}
submitAssessment(
{SOAPViewModel model,
MySelectedAssessment mySelectedAssessment,
bool isUpdate = false}) async {
submitAssessment({SOAPViewModel model, MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async {
GifLoaderDialogUtils.showMyDialog(context);
if (isUpdate) {
PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel(
@ -448,18 +375,14 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
await model.patchAssessment(patchAssessmentReqModel);
} else {
PostAssessmentRequestModel postAssessmentRequestModel =
new PostAssessmentRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
icdCodeDetails: [
new IcdCodeDetails(
remarks: mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: mySelectedAssessment.selectedICD.code)
]);
new PostAssessmentRequestModel(patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, icdCodeDetails: [
new IcdCodeDetails(
remarks: mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: mySelectedAssessment.selectedICD.code)
]);
await model.postAssessment(postAssessmentRequestModel);
}

Loading…
Cancel
Save