WD: Changes of apis and flows performed.

1. diagnosis restricted for operation  after the resolution or deletion of diagnosis.
2. pomrid in episode api.
update_flutter_3.24_vida_plus_episode
taha.alam 11 months ago
parent 5ecee03052
commit 8f05d526f6

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/NavigationService.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/exception_report.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:flutter/cupertino.dart';
@ -165,8 +166,15 @@ class BaseAppClient {
} else
onSuccess(parsed, statusCode);
} else {
if(body['DoctorID'] !=null )
postFailureResponse(doctorId:body['DoctorID'], url:url , request: json.encode(body), response: response.body, exception: getError(parsed));
if(body['DoctorID'] !=null ) {
postFailureResponse(
doctorId: body['DoctorID'],
url: url,
request: json.encode(body),
response: response.body,
exception: getError(parsed));
}
onFailure(getError(parsed), statusCode);
}
}

@ -326,7 +326,7 @@ const FAVORITE_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/DiagnosisGetFavo
const ADD_TO_FAVORITE_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/DiagnosisAddFavourite';
const MAKE_PREVIOUS_AS_CURRENT_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/ContinuePreviousEpisode';
const MAKE_PREVIOUS_AS_CURRENT_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/CreateDiagnosis';
const SEARCH_PHYSICAL_EXAMINATION = 'Services/DoctorApplication.svc/REST/SearchPhysicalExam';

@ -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,

@ -1335,7 +1335,10 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.BusyLocal);
var result = await _SOAPService.convertPreviousDiagnosisCurrent(
paitientInfo, diagnosis);
if (result) await getPreviousPatientDetails(paitientInfo);
if (result) {
await getPreviousPatientDetails(paitientInfo);
await getCurrentDiagnosisList(paitientInfo);
}
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);

@ -110,6 +110,21 @@ class _CurrentDiagnosisState extends State<CurrentDiagnosis> {
'');
break;
case SoapDetailItemActions.EDIT:
if (widget.currentDiagnosisItems[index]
.status ==
"Deleted") {
DrAppToastMsg.showErrorToast(TranslationBase.of(context).diagnosisAlreadyDeleted);
return;
}
if (widget.currentDiagnosisItems[index]
.resolved ==
true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.diagnosisAlreadyResolved);
}
bool result = await Navigator.push(
context,
FadePage(
@ -124,6 +139,12 @@ class _CurrentDiagnosisState extends State<CurrentDiagnosis> {
}
break;
case SoapDetailItemActions.RESOLVE:
if (widget.currentDiagnosisItems[index]
.status ==
"Deleted") {
DrAppToastMsg.showErrorToast(TranslationBase.of(context).diagnosisAlreadyDeleted);
return;
}
if (widget.currentDiagnosisItems[index]
.resolved ==
true) {

@ -291,6 +291,7 @@ class _ComplaintSelectionState extends State<ComplaintSelection> {
onPressed: () {
if(searchController.text.isNotEmpty) {
widget.onSave?.call(searchController.text);
searchController.text ='';
}
}): SizedBox.shrink(),
),
@ -298,6 +299,7 @@ class _ComplaintSelectionState extends State<ComplaintSelection> {
onEditingComplete: (){
if(searchController.text.isNotEmpty) {
widget.onSave?.call(searchController.text);
searchController.text ='';
}
},
)),

Loading…
Cancel
Save