|
|
|
|
@ -39,6 +39,7 @@ import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/get_physical_ex
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/post_physical_exam_request_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/Clinic.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/PatientCondition.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/progress_note.dart';
|
|
|
|
|
@ -80,7 +81,8 @@ class SOAPService extends LookupService {
|
|
|
|
|
List<SearchDiagnosis> searchDiagnosisList = [];
|
|
|
|
|
List<PatientPhysicalExamination> patientPhysicalExaminationList = [];
|
|
|
|
|
List<GeneralSpeciality> generalSpeciality = [];
|
|
|
|
|
List<Clinic> clinicsList = [];
|
|
|
|
|
List<SOAPClinic> clinicsList = [];
|
|
|
|
|
List<PatientCondition> patientConditionList = [];
|
|
|
|
|
Map<String, List<Category>> specialityDetails = {};
|
|
|
|
|
Map<String, dynamic> diagnosisTypeList = {};
|
|
|
|
|
Map<String, dynamic> conditionTypeList = {};
|
|
|
|
|
@ -447,6 +449,7 @@ class SOAPService extends LookupService {
|
|
|
|
|
searchAllergiesList.add(AllergiesListVidaPlus.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
searchAllergiesList.clear();
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: {
|
|
|
|
|
@ -624,13 +627,16 @@ class SOAPService extends LookupService {
|
|
|
|
|
..addAll(request)
|
|
|
|
|
..addAll(req);
|
|
|
|
|
hasError = false;
|
|
|
|
|
bool success = false;
|
|
|
|
|
await baseAppClient.post(CREATE_HOPI,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
DrAppToastMsg.showSuccesToast("History Saved Successfully");
|
|
|
|
|
success = true;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: finalRequest);
|
|
|
|
|
return success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getHopi(PatiantInformtion patient) async {
|
|
|
|
|
@ -720,7 +726,7 @@ class SOAPService extends LookupService {
|
|
|
|
|
"diseaseCode": diagnosis,
|
|
|
|
|
};
|
|
|
|
|
hasError = false;
|
|
|
|
|
searchDiagnosisList.clear();
|
|
|
|
|
clearSearchResult();
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(SEARCH_DIAGNOSIS,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
@ -728,12 +734,17 @@ class SOAPService extends LookupService {
|
|
|
|
|
.forEach((v) => searchDiagnosisList.add(SearchDiagnosis.fromJson(v)));
|
|
|
|
|
_processData();
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
searchChiefComplaintListVidaPlus.clear();
|
|
|
|
|
clearSearchResult();
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
clearSearchResult(){
|
|
|
|
|
searchDiagnosisList.clear();
|
|
|
|
|
icdVersionList.clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _processData() {
|
|
|
|
|
Set<String> icdVersions = {};
|
|
|
|
|
for (var item in searchDiagnosisList) {
|
|
|
|
|
@ -811,21 +822,21 @@ class SOAPService extends LookupService {
|
|
|
|
|
|
|
|
|
|
getPreviousDiagnosis(PatiantInformtion patient) async {
|
|
|
|
|
Map<String, dynamic> request = {
|
|
|
|
|
// "HospitalGroupID": await sharedPref.getString(DOCTOR_SETUP_ID), //setup
|
|
|
|
|
// "hospitalId": patient.projectId,
|
|
|
|
|
// "patientId": patient.patientId,
|
|
|
|
|
// "patientPomrId": patient.pomrId,
|
|
|
|
|
// "startRow": 0,
|
|
|
|
|
// "endRow": 1000,
|
|
|
|
|
// "ProjectID": patient.projectId
|
|
|
|
|
//todo just for the test as the create diagnosis is still not working
|
|
|
|
|
"HospitalGroupID": 105,
|
|
|
|
|
"hospitalId": 313,
|
|
|
|
|
"patientId": 70010976,
|
|
|
|
|
"patientPomrId": 8414,
|
|
|
|
|
"HospitalGroupID": await sharedPref.getString(DOCTOR_SETUP_ID), //setup
|
|
|
|
|
"hospitalId": patient.projectId,
|
|
|
|
|
"patientId": patient.patientId,
|
|
|
|
|
"patientPomrId": patient.pomrId,
|
|
|
|
|
"startRow": 0,
|
|
|
|
|
"endRow": 2,
|
|
|
|
|
"ProjectID": 313
|
|
|
|
|
"endRow": 1000,
|
|
|
|
|
"ProjectID": patient.projectId
|
|
|
|
|
//todo just for the test as the create diagnosis is still not working
|
|
|
|
|
// "HospitalGroupID": 105,
|
|
|
|
|
// "hospitalId": 313,
|
|
|
|
|
// "patientId": 70010976,
|
|
|
|
|
// "patientPomrId": 8414,
|
|
|
|
|
// "startRow": 0,
|
|
|
|
|
// "endRow": 2,
|
|
|
|
|
// "ProjectID": 313
|
|
|
|
|
};
|
|
|
|
|
hasError = false;
|
|
|
|
|
patientPreviousDiagnosisList.clear();
|
|
|
|
|
@ -843,21 +854,21 @@ class SOAPService extends LookupService {
|
|
|
|
|
|
|
|
|
|
getDiagnosis(PatiantInformtion patient) async {
|
|
|
|
|
Map<String, dynamic> request = {
|
|
|
|
|
"hospitalGroupId": 105,
|
|
|
|
|
"hospitalId": 313,
|
|
|
|
|
"patientId": 70023498,
|
|
|
|
|
"patientPomrId": 9907,
|
|
|
|
|
"startRow": 0,
|
|
|
|
|
"endRow": 10,
|
|
|
|
|
"isSelected": true,
|
|
|
|
|
"ProjectID": 313
|
|
|
|
|
// "hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
|
|
|
|
|
// "hospitalId": patient.projectId,
|
|
|
|
|
// "patientId": patient.patientId,
|
|
|
|
|
// "patientPomrId": patient.pomrId,
|
|
|
|
|
// "hospitalGroupId": 105,
|
|
|
|
|
// "hospitalId": 313,
|
|
|
|
|
// "patientId": 70023498,
|
|
|
|
|
// "patientPomrId": 9907,
|
|
|
|
|
// "startRow": 0,
|
|
|
|
|
// "endRow": 1000000,
|
|
|
|
|
// "ProjectID": patient.projectId
|
|
|
|
|
// "endRow": 10,
|
|
|
|
|
// "isSelected": true,
|
|
|
|
|
// "ProjectID": 313
|
|
|
|
|
"hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
|
|
|
|
|
"hospitalId": patient.projectId,
|
|
|
|
|
"patientId": patient.patientId,
|
|
|
|
|
"patientPomrId": patient.pomrId,
|
|
|
|
|
"startRow": 0,
|
|
|
|
|
"endRow": 1000000,
|
|
|
|
|
"ProjectID": patient.projectId
|
|
|
|
|
};
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(GET_LIST_OF_DIAGNOSIS,
|
|
|
|
|
@ -875,31 +886,33 @@ class SOAPService extends LookupService {
|
|
|
|
|
removeDiagnosis(PatiantInformtion patientInfo, String? patientProblemId,
|
|
|
|
|
String? problemId, String? deletedRemarks) async {
|
|
|
|
|
Map<String, dynamic> request = {
|
|
|
|
|
// "patientProblemId": patientProblemId,
|
|
|
|
|
// "patientId": patientInfo.patientId,
|
|
|
|
|
// "problemId": problemId,
|
|
|
|
|
// "deletedRemarks": deletedRemarks,
|
|
|
|
|
// "ProjectID": patientInfo.projectId,
|
|
|
|
|
// "setupId": await sharedPref.getString(DOCTOR_SETUP_ID)
|
|
|
|
|
"patientProblemId": patientProblemId,
|
|
|
|
|
"patientId": patientInfo.patientId,
|
|
|
|
|
"problemId": problemId,
|
|
|
|
|
"deletedRemarks": deletedRemarks,
|
|
|
|
|
"ProjectID": patientInfo.projectId,
|
|
|
|
|
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID)
|
|
|
|
|
//todo just for the test as the create diagnosis is still not working
|
|
|
|
|
"patientProblemId": 13691,
|
|
|
|
|
"patientId": 70010986,
|
|
|
|
|
"problemId": 41698,
|
|
|
|
|
"deletedRemarks": "kethees test",
|
|
|
|
|
"ProjectID": 313,
|
|
|
|
|
"setupId": 105
|
|
|
|
|
// "patientProblemId": 13691,
|
|
|
|
|
// "patientId": 70010986,
|
|
|
|
|
// "problemId": 41698,
|
|
|
|
|
// "deletedRemarks": "kethees test",
|
|
|
|
|
// "ProjectID": 313,
|
|
|
|
|
// "setupId": 105
|
|
|
|
|
};
|
|
|
|
|
hasError = false;
|
|
|
|
|
var success = false;
|
|
|
|
|
patientPreviousDiagnosisList.clear();
|
|
|
|
|
await baseAppClient.post(REMOVE_DIAGNOSIS,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
DrAppToastMsg.showSuccesToast(response['ListDiagnosisRemove']['message']);
|
|
|
|
|
//todo get the current diagnosis after the delete if it is successful
|
|
|
|
|
success = true;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
patientPreviousDiagnosisList.clear();
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
favoriteDiagnosis(
|
|
|
|
|
@ -1025,7 +1038,6 @@ class SOAPService extends LookupService {
|
|
|
|
|
};
|
|
|
|
|
hasError = false;
|
|
|
|
|
var isFavoriteAdded = false;
|
|
|
|
|
favoriteDiagnosisDetailsList.clear();
|
|
|
|
|
await baseAppClient.post(ADD_TO_FAVORITE_DIAGNOSIS,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
var result = response['ListDiagnosisAddFavourite']['resultData'];
|
|
|
|
|
@ -1038,7 +1050,6 @@ class SOAPService extends LookupService {
|
|
|
|
|
response['ListDiagnosisAddFavourite']['message']);
|
|
|
|
|
}
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
favoriteDiagnosisDetailsList.clear();
|
|
|
|
|
hasError = true;
|
|
|
|
|
isFavoriteAdded = false;
|
|
|
|
|
super.error = error;
|
|
|
|
|
@ -1047,7 +1058,7 @@ class SOAPService extends LookupService {
|
|
|
|
|
return isFavoriteAdded;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
convertPreviousDiagnosisCurrent(PatiantInformtion paitientInfo,
|
|
|
|
|
Future<bool> convertPreviousDiagnosisCurrent(PatiantInformtion paitientInfo,
|
|
|
|
|
PatientPreviousDiagnosis diagnosis) async {
|
|
|
|
|
Map<String, dynamic> request = {
|
|
|
|
|
"patientProblemRevisionId": diagnosis.patientProblemRevisionId,
|
|
|
|
|
@ -1064,18 +1075,21 @@ class SOAPService extends LookupService {
|
|
|
|
|
"ProjectID": paitientInfo.projectId
|
|
|
|
|
};
|
|
|
|
|
hasError = false;
|
|
|
|
|
var addedToFavorite = false;
|
|
|
|
|
var success = false;
|
|
|
|
|
await baseAppClient.post(MAKE_PREVIOUS_AS_CURRENT_DIAGNOSIS,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) async {
|
|
|
|
|
var result = response['ContinuePreviousEpisode']['resultData'];
|
|
|
|
|
if ((result as List).isEmpty) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
response['ContinuePreviousEpisode']['message']);
|
|
|
|
|
} else {
|
|
|
|
|
success = true;
|
|
|
|
|
}
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future getProgressNoteNew(PatiantInformtion patientInformation) async {
|
|
|
|
|
@ -1184,6 +1198,88 @@ class SOAPService extends LookupService {
|
|
|
|
|
return success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<bool> createDiagnosisFromFavorite(
|
|
|
|
|
PatiantInformtion patient,
|
|
|
|
|
FavoriteDiseaseDetails? searchDiagnosis,
|
|
|
|
|
String? diagnosisType,
|
|
|
|
|
String conditionType,
|
|
|
|
|
String remarks,
|
|
|
|
|
bool isNew) async {
|
|
|
|
|
Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER);
|
|
|
|
|
var request = {
|
|
|
|
|
"pomrId": patient.pomrId,
|
|
|
|
|
"appointmentId": patient.appointmentNo,
|
|
|
|
|
"clinicGroupId": patient.clinicGroupId,
|
|
|
|
|
"clinicId": patient.clinicId,
|
|
|
|
|
"patientId": patient.patientId,
|
|
|
|
|
"hospitalId": searchDiagnosis!.hospitalId,
|
|
|
|
|
"hospitalGroupId": searchDiagnosis.hospitalGroupId,
|
|
|
|
|
"diagnosisType": diagnosisType,
|
|
|
|
|
"condition": conditionType,
|
|
|
|
|
"remarks": remarks,
|
|
|
|
|
"icdType": searchDiagnosis.icdType,
|
|
|
|
|
// "icdVersion": searchDiagnosis.icdVersion,
|
|
|
|
|
"icdSubVersion": searchDiagnosis.icdSubVersion,
|
|
|
|
|
"isNew": isNew,
|
|
|
|
|
"specificationId": searchDiagnosis.specificationId,
|
|
|
|
|
"selectedDisease": searchDiagnosis.diseases,
|
|
|
|
|
"diseasesCode": searchDiagnosis.diseasesCode,
|
|
|
|
|
"diseasesId": searchDiagnosis.diseasesId,
|
|
|
|
|
"selectedIcdCode": searchDiagnosis.icdId,
|
|
|
|
|
"selectedCategoryCode": searchDiagnosis.categoryCode,
|
|
|
|
|
"selectedSectionCode": searchDiagnosis.sectionCode,
|
|
|
|
|
"selectedChapterCode": searchDiagnosis.chapterCode,
|
|
|
|
|
// "selectedNandaCode": searchDiagnosis.selectedNandaCode,
|
|
|
|
|
"isResolved": false,
|
|
|
|
|
"doctorId": patient.doctorId,
|
|
|
|
|
"doctorCode": user?['List_MemberInformation'][0]['MemberID'],
|
|
|
|
|
"ProjectID": patient.projectId,
|
|
|
|
|
"codeRange": searchDiagnosis.codeRange
|
|
|
|
|
};
|
|
|
|
|
var success = false;
|
|
|
|
|
await baseAppClient.post(CREATE_DIAGNOSIS,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
DrAppToastMsg.showSuccesToast(response['CreatDiagnosis']['message']);
|
|
|
|
|
success = true;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
success = false;
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
|
|
|
|
|
return success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<bool> createProgressNote(PatiantInformtion patient, String? clinicID,
|
|
|
|
|
String conditionType, String note, ) async {
|
|
|
|
|
Map<String, dynamic> request = {
|
|
|
|
|
"planNote": note,
|
|
|
|
|
"PatientMRN": patient.patientMRN,
|
|
|
|
|
"EpisodeID": patient.episodeNo,
|
|
|
|
|
"CreatedByName": patient.doctorName,
|
|
|
|
|
"CreatedBy": patient.doctorId,
|
|
|
|
|
"Speciality": clinicID,
|
|
|
|
|
"ProgressNotesTypes": "DOCTOR_NOTE",
|
|
|
|
|
"PatientCondition": conditionType,
|
|
|
|
|
"ProjectID": patient.projectId
|
|
|
|
|
};
|
|
|
|
|
var success = false;
|
|
|
|
|
await baseAppClient.post(CREATE_PROGRESS_NOTE,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
if (response['ListCreateProgressNote'] != null) {
|
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
|
response['ListCreateProgressNote']['message']);
|
|
|
|
|
success = true;
|
|
|
|
|
}
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
success = false;
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
|
|
|
|
|
return success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<bool> editDiagnosis(PatientPreviousDiagnosis diagnosis) async {
|
|
|
|
|
var request = diagnosis.toJson();
|
|
|
|
|
var success = false;
|
|
|
|
|
@ -1242,8 +1338,25 @@ class SOAPService extends LookupService {
|
|
|
|
|
var success = false;
|
|
|
|
|
await baseAppClient.post(GET_CLINIC,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
response['ListDoctorClinics'].forEach((v) => v['categories']
|
|
|
|
|
.forEach((cat) => clinicsList.add(Clinic.fromJson(cat))));
|
|
|
|
|
response['ListDoctorClinics']
|
|
|
|
|
.forEach((v) => clinicsList.add(SOAPClinic.fromJson(v)));
|
|
|
|
|
success = false;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
success = false;
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
|
|
|
|
|
return success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<bool> getPatientCondition() async {
|
|
|
|
|
Map<String, dynamic> request = {};
|
|
|
|
|
var success = false;
|
|
|
|
|
await baseAppClient.post(GET_PATIENT_CLINIC,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
response['ListPatientConditionProgress']['resultData'].forEach((v) => v['PATIENT_CONDITION'].forEach(
|
|
|
|
|
(item) => patientConditionList.add(PatientCondition.fromJson(item))));
|
|
|
|
|
success = false;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
success = false;
|
|
|
|
|
|