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 1 year 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/service/NavigationService.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.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_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/exception_report.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -165,8 +166,15 @@ class BaseAppClient {
} else } else
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if(body['DoctorID'] !=null ) if(body['DoctorID'] !=null ) {
postFailureResponse(doctorId:body['DoctorID'], url:url , request: json.encode(body), response: response.body, exception: getError(parsed));
postFailureResponse(
doctorId: body['DoctorID'],
url: url,
request: json.encode(body),
response: response.body,
exception: getError(parsed));
}
onFailure(getError(parsed), statusCode); 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 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'; const SEARCH_PHYSICAL_EXAMINATION = 'Services/DoctorApplication.svc/REST/SearchPhysicalExam';

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

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

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

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

Loading…
Cancel
Save