|
|
|
|
@ -458,17 +458,16 @@ class SOAPService extends LookupService {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future addAllergies(
|
|
|
|
|
AllergiesListVidaPlus allergy, PatiantInformtion patientInfo, bool isNoKnown) async {
|
|
|
|
|
if(!isNoKnown){
|
|
|
|
|
allergy.allergyReactionDTOs!.forEach((value) {
|
|
|
|
|
value.patientID = patientInfo.patientMRN;
|
|
|
|
|
value.pomrid = int.parse(patientInfo.pomrId!);
|
|
|
|
|
value.allergyReactionMappingID = 1;
|
|
|
|
|
value.severity = value.severity ?? 1;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
Future addAllergies(AllergiesListVidaPlus allergy,
|
|
|
|
|
PatiantInformtion patientInfo, bool isNoKnown) async {
|
|
|
|
|
if (!isNoKnown) {
|
|
|
|
|
allergy.allergyReactionDTOs!.forEach((value) {
|
|
|
|
|
value.patientID = patientInfo.patientMRN;
|
|
|
|
|
value.pomrid = int.parse(patientInfo.pomrId!);
|
|
|
|
|
value.allergyReactionMappingID = 1;
|
|
|
|
|
value.severity = value.severity ?? 1;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
var request = {
|
|
|
|
|
"patientsAllergyRevisionID": allergy.allergyRevisionID,
|
|
|
|
|
"patientMRN": patientInfo.patientMRN,
|
|
|
|
|
@ -490,15 +489,15 @@ class SOAPService extends LookupService {
|
|
|
|
|
"allergyTypeID": allergy.allergyTypeID,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if(isNoKnown){
|
|
|
|
|
request['isAllergy'] ='NO_KNOWN_ALLERGIES';
|
|
|
|
|
if (isNoKnown) {
|
|
|
|
|
request['isAllergy'] = 'NO_KNOWN_ALLERGIES';
|
|
|
|
|
request['allergyName'] = "No Known Allergies";
|
|
|
|
|
request['userType'] ='DOCTOR';
|
|
|
|
|
request['allergyTypeID'] = request['allergyID'] = 0;
|
|
|
|
|
request['userType'] = 'DOCTOR';
|
|
|
|
|
request['allergyTypeID'] = request['allergyID'] = 0;
|
|
|
|
|
request['isActive'] = true;
|
|
|
|
|
request['remarks'] ="";
|
|
|
|
|
request['isActivePatientsAllergy'] =true;
|
|
|
|
|
request['patientsAllergyReactionsDTOs'] =[];
|
|
|
|
|
request['remarks'] = "";
|
|
|
|
|
request['isActivePatientsAllergy'] = true;
|
|
|
|
|
request['patientsAllergyReactionsDTOs'] = [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hasError = false;
|
|
|
|
|
@ -688,10 +687,9 @@ class SOAPService extends LookupService {
|
|
|
|
|
"pomrId": patient.pomrId,
|
|
|
|
|
"patientMRN": patient.patientMRN,
|
|
|
|
|
"chiefComplaint": cheifComplaint,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"setupId":await sharedPref.getString(DOCTOR_SETUP_ID)
|
|
|
|
|
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID)
|
|
|
|
|
};
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(POST_CHIEF_COMPLAINT_VP,
|
|
|
|
|
@ -737,13 +735,13 @@ class SOAPService extends LookupService {
|
|
|
|
|
.forEach((v) => searchDiagnosisList.add(SearchDiagnosis.fromJson(v)));
|
|
|
|
|
_processData();
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
clearSearchResult();
|
|
|
|
|
clearSearchResult();
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
clearSearchResult(){
|
|
|
|
|
clearSearchResult() {
|
|
|
|
|
searchDiagnosisList.clear();
|
|
|
|
|
icdVersionList.clear();
|
|
|
|
|
}
|
|
|
|
|
@ -865,7 +863,7 @@ class SOAPService extends LookupService {
|
|
|
|
|
// "endRow": 10,
|
|
|
|
|
// "isSelected": true,
|
|
|
|
|
// "ProjectID": 313
|
|
|
|
|
"hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
|
|
|
|
|
"hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
|
|
|
|
|
"hospitalId": patient.projectId,
|
|
|
|
|
"patientId": patient.patientId,
|
|
|
|
|
"patientPomrId": patient.pomrId,
|
|
|
|
|
@ -1046,11 +1044,17 @@ class SOAPService extends LookupService {
|
|
|
|
|
var result = response['ListDiagnosisAddFavourite']['resultData'];
|
|
|
|
|
isFavoriteAdded = true;
|
|
|
|
|
if ((result is List) && (result as List).isEmpty) {
|
|
|
|
|
if(response['ListDiagnosisAddFavourite']['message'] != null)
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
response['ListDiagnosisAddFavourite']['message']);
|
|
|
|
|
|
|
|
|
|
else DrAppToastMsg.showErrorToast("Unable to Add");
|
|
|
|
|
} else {
|
|
|
|
|
if(response['ListDiagnosisAddFavourite']['message'] != null)
|
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
|
response['ListDiagnosisAddFavourite']['message']);
|
|
|
|
|
else DrAppToastMsg.showErrorToast("Diagnosis Added To Favorite");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
@ -1061,33 +1065,45 @@ class SOAPService extends LookupService {
|
|
|
|
|
return isFavoriteAdded;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<bool> convertPreviousDiagnosisCurrent(PatiantInformtion paitientInfo,
|
|
|
|
|
PatientPreviousDiagnosis diagnosis) async {
|
|
|
|
|
Future<bool> convertPreviousDiagnosisCurrent(
|
|
|
|
|
PatiantInformtion patient, PatientPreviousDiagnosis diagnosis) async {
|
|
|
|
|
Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER);
|
|
|
|
|
Map<String, dynamic> request = {
|
|
|
|
|
"patientProblemRevisionId": diagnosis.patientProblemRevisionId,
|
|
|
|
|
"patientId": paitientInfo.patientId,
|
|
|
|
|
"doctorId": paitientInfo.doctorId,
|
|
|
|
|
"pomrId": paitientInfo.pomrId,
|
|
|
|
|
"appointmentId": paitientInfo.appointmentNo,
|
|
|
|
|
"createdBy": diagnosis.createdBy,
|
|
|
|
|
"hospitalId": diagnosis.hospitalId,
|
|
|
|
|
"hospitalGroupId": diagnosis.hospitalGroupId,
|
|
|
|
|
"clinicGroupId": diagnosis.clinicGroupId,
|
|
|
|
|
"clinicId": diagnosis.clinicId,
|
|
|
|
|
"isSelected": true,
|
|
|
|
|
"ProjectID": paitientInfo.projectId
|
|
|
|
|
"pomrId": patient.pomrId,
|
|
|
|
|
"appointmentId": patient.appointmentNo,
|
|
|
|
|
"clinicGroupId": patient.clinicGroupId,
|
|
|
|
|
"clinicId": patient.clinicId,
|
|
|
|
|
"patientId": patient.patientId,
|
|
|
|
|
"hospitalId": patient.projectId,
|
|
|
|
|
"hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
|
|
|
|
|
"diagnosisType": diagnosis.diagnosisType,
|
|
|
|
|
"condition": diagnosis.condition,
|
|
|
|
|
"remarks": diagnosis.remarks,
|
|
|
|
|
"icdType": diagnosis.icdType,
|
|
|
|
|
// "icdVersion": searchDiagnosis.icdVersion,
|
|
|
|
|
"icdSubVersion": diagnosis.icdSubVersion,
|
|
|
|
|
"isNew": false,
|
|
|
|
|
"specificationId": diagnosis.problemId,
|
|
|
|
|
"selectedDisease": diagnosis.selectedDisease,
|
|
|
|
|
// "diseasesCode": diagnosis.visitWisePatientDiagnoses?.last.diseasesCode,
|
|
|
|
|
// "diseasesId": searchDiagnosis.diseasesId,
|
|
|
|
|
"selectedIcdCode": diagnosis.selectedIcdCode,
|
|
|
|
|
"selectedCategoryCode": diagnosis.selectedCategoryCode,
|
|
|
|
|
"selectedSectionCode": diagnosis.selectedSectionCode,
|
|
|
|
|
"selectedChapterCode": diagnosis.selectedChapterCode,
|
|
|
|
|
// "selectedNandaCode": diagnosis.selectedNandaCode,
|
|
|
|
|
"isResolved": false,
|
|
|
|
|
"doctorId": patient.doctorId,
|
|
|
|
|
"doctorCode": user?['List_MemberInformation'][0]['MemberID'],
|
|
|
|
|
"ProjectID": patient.projectId,
|
|
|
|
|
// "codeRange": searchDiagnosis.codeRange
|
|
|
|
|
};
|
|
|
|
|
hasError = false;
|
|
|
|
|
var success = false;
|
|
|
|
|
await baseAppClient.post(MAKE_PREVIOUS_AS_CURRENT_DIAGNOSIS,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) async {
|
|
|
|
|
var result = response['ContinuePreviousEpisode']['resultData'];
|
|
|
|
|
if ((result as List).isEmpty) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
response['ContinuePreviousEpisode']['message']);
|
|
|
|
|
} else {
|
|
|
|
|
success = true;
|
|
|
|
|
}
|
|
|
|
|
DrAppToastMsg.showSuccesToast(response['CreatDiagnosis']['message']);
|
|
|
|
|
success = true;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
@ -1163,12 +1179,12 @@ class SOAPService extends LookupService {
|
|
|
|
|
"clinicGroupId": patient.clinicGroupId,
|
|
|
|
|
"clinicId": patient.clinicId,
|
|
|
|
|
"patientId": patient.patientId,
|
|
|
|
|
"hospitalId": searchDiagnosis!.hospitalId,
|
|
|
|
|
"hospitalGroupId": searchDiagnosis.hospitalGroupId,
|
|
|
|
|
"hospitalId": patient.projectId,
|
|
|
|
|
"hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
|
|
|
|
|
"diagnosisType": diagnosisType,
|
|
|
|
|
"condition": conditionType,
|
|
|
|
|
"remarks": remarks,
|
|
|
|
|
"icdType": searchDiagnosis.icdType,
|
|
|
|
|
"icdType": searchDiagnosis!.icdType,
|
|
|
|
|
// "icdVersion": searchDiagnosis.icdVersion,
|
|
|
|
|
"icdSubVersion": searchDiagnosis.icdSubVersion,
|
|
|
|
|
"isNew": isNew,
|
|
|
|
|
@ -1215,12 +1231,12 @@ class SOAPService extends LookupService {
|
|
|
|
|
"clinicGroupId": patient.clinicGroupId,
|
|
|
|
|
"clinicId": patient.clinicId,
|
|
|
|
|
"patientId": patient.patientId,
|
|
|
|
|
"hospitalId": searchDiagnosis!.hospitalId,
|
|
|
|
|
"hospitalGroupId": searchDiagnosis.hospitalGroupId,
|
|
|
|
|
"hospitalId": patient.projectId,
|
|
|
|
|
"hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
|
|
|
|
|
"diagnosisType": diagnosisType,
|
|
|
|
|
"condition": conditionType,
|
|
|
|
|
"remarks": remarks,
|
|
|
|
|
"icdType": searchDiagnosis.icdType,
|
|
|
|
|
"icdType": searchDiagnosis!.icdType,
|
|
|
|
|
// "icdVersion": searchDiagnosis.icdVersion,
|
|
|
|
|
"icdSubVersion": searchDiagnosis.icdSubVersion,
|
|
|
|
|
"isNew": isNew,
|
|
|
|
|
@ -1253,8 +1269,12 @@ class SOAPService extends LookupService {
|
|
|
|
|
return success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<bool> createProgressNote(PatiantInformtion patient, String? clinicID,
|
|
|
|
|
String conditionType, String note, ) async {
|
|
|
|
|
Future<bool> createProgressNote(
|
|
|
|
|
PatiantInformtion patient,
|
|
|
|
|
String? clinicID,
|
|
|
|
|
String conditionType,
|
|
|
|
|
String note,
|
|
|
|
|
) async {
|
|
|
|
|
Map<String, dynamic> request = {
|
|
|
|
|
"planNote": note,
|
|
|
|
|
"PatientMRN": patient.patientMRN,
|
|
|
|
|
@ -1326,6 +1346,14 @@ class SOAPService extends LookupService {
|
|
|
|
|
success = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(response['ValidatinErrorsCSI']!= null){
|
|
|
|
|
if(response['ValidatinErrorsCSI']['errors']!= null && (response['ValidatinErrorsCSI']['errors'] as List).isNotEmpty ){
|
|
|
|
|
if(response['ValidatinErrorsCSI']['errors']['Validations']!= null && (response['ValidatinErrorsCSI']['errors']['Validations'] as List).isNotEmpty ) {
|
|
|
|
|
if((response['ValidatinErrorsCSI']['errors']['Validations'] as List).first!['Error'] != null )
|
|
|
|
|
DrAppToastMsg.showErrorToast((response['ValidatinErrorsCSI']['errors']['Validations'] as List).first!['Error']);
|
|
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
}
|
|
|
|
|
success = false;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
success = false;
|
|
|
|
|
@ -1358,8 +1386,9 @@ class SOAPService extends LookupService {
|
|
|
|
|
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))));
|
|
|
|
|
response['ListPatientConditionProgress']['resultData'].forEach((v) =>
|
|
|
|
|
v['PATIENT_CONDITION'].forEach((item) =>
|
|
|
|
|
patientConditionList.add(PatientCondition.fromJson(item))));
|
|
|
|
|
success = false;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
success = false;
|
|
|
|
|
@ -1398,18 +1427,18 @@ class SOAPService extends LookupService {
|
|
|
|
|
}, body: request);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
continueEpisodeVidaPlusFromPrevious(
|
|
|
|
|
PatiantInformtion patient, ChiefComplains chiefComplaint, String chiefComplainTemplateId) async {
|
|
|
|
|
continueEpisodeVidaPlusFromPrevious(PatiantInformtion patient,
|
|
|
|
|
ChiefComplains chiefComplaint, String chiefComplainTemplateId) async {
|
|
|
|
|
List<Map<String, dynamic>> chiefComplaintList = [];
|
|
|
|
|
var listofComplain = {
|
|
|
|
|
chiefComplaint.chiefComplain :chiefComplainTemplateId
|
|
|
|
|
chiefComplaint.chiefComplain: chiefComplainTemplateId
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> request = {
|
|
|
|
|
"appointmentId": patient.appointmentNo,
|
|
|
|
|
"projectId": patient.projectId,
|
|
|
|
|
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID),
|
|
|
|
|
"chiefComplain":listofComplain
|
|
|
|
|
"chiefComplain": listofComplain
|
|
|
|
|
};
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(CONTINUE_EPISODE_VP,
|
|
|
|
|
@ -1430,7 +1459,7 @@ class SOAPService extends LookupService {
|
|
|
|
|
"PatientName": patient.firstName! + ' ' + patient.lastName!,
|
|
|
|
|
"addedChiefComplaintCreateDtos": [],
|
|
|
|
|
"removedChiefComplaintIds": [chiefComplaint.chiefComplainId],
|
|
|
|
|
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID),
|
|
|
|
|
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID),
|
|
|
|
|
};
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(UPDATE_CHIEF_COMPLAINT,
|
|
|
|
|
@ -1448,7 +1477,8 @@ class SOAPService extends LookupService {
|
|
|
|
|
Map<String, dynamic> request = {
|
|
|
|
|
"patientId": patient.patientId,
|
|
|
|
|
"clinicId": patient.clinicId,
|
|
|
|
|
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID),
|
|
|
|
|
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID),
|
|
|
|
|
"pomrId":patient.pomrId
|
|
|
|
|
};
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(EPISODE_BY_CHIEF_COMPLAINT,
|
|
|
|
|
|