allergies changes

update_flutter_3.24_vida_plus_episode_MDS
Sultan khan 11 months ago
parent f7ed4b6c68
commit 4bb68778dc

@ -456,13 +456,15 @@ class SOAPService extends LookupService {
}
Future addAllergies(
AllergiesListVidaPlus allergy, PatiantInformtion patientInfo) async {
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;
});
}
var request = {
"patientsAllergyRevisionID": allergy.allergyRevisionID,
"patientMRN": patientInfo.patientMRN,
@ -481,9 +483,21 @@ class SOAPService extends LookupService {
"dbCRUDOperation": 1,
"allergyID": allergy.allergyID,
"allergyName": allergy.allergyName,
"allergyTypeID": allergy.allergyTypeID
"allergyTypeID": allergy.allergyTypeID,
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID)
};
if(isNoKnown){
request['isAllergy'] ='NO_KNOWN_ALLERGIES';
request['allergyName'] = "No Known Allergies";
request['userType'] ='DOCTOR';
request['allergyTypeID'] = request['allergyID'] = 0;
request['isActive'] = true;
request['remarks'] ="";
request['isActivePatientsAllergy'] =true;
request['patientsAllergyReactionsDTOs'] =[];
}
hasError = false;
await baseAppClient.post(POST_ALLERGIES,

@ -1018,9 +1018,9 @@ class SOAPViewModel extends BaseViewModel {
}
addAllergies(
AllergiesListVidaPlus request, PatiantInformtion patientInfo) async {
AllergiesListVidaPlus request, PatiantInformtion patientInfo, {bool isNoKnown =false}) async {
setState(ViewState.BusyLocal);
await _SOAPService.addAllergies(request, patientInfo);
await _SOAPService.addAllergies(request, patientInfo, isNoKnown);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);

@ -302,7 +302,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
});
}else {
Navigator.of(context).pushNamed(
UPDATE_EPISODE_VIDA_PLUS, arguments: {
UPDATE_EPISODE, arguments: {
'patient': patient
});
}

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/core/model/SOAP/allergy/get_allergies_list_vida_plus.dart';
import 'package:doctor_app_flutter/core/model/SOAP/allergy/get_patient_allergies_list_vida_plus.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart';
@ -73,7 +74,12 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidgetVidaPlus> {
activeColor: Colors.red,
onChanged: (value) {
noKnownAllergies = value!;
setState(() {});
if(value){
setNoKnownAllergy(model);
}
setState(() {
});
},
materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap,
@ -269,4 +275,17 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidgetVidaPlus> {
});
});
}
setNoKnownAllergy(SOAPViewModel model) async {
GifLoaderDialogUtils.showMyDialog(context);
AllergiesListVidaPlus request= AllergiesListVidaPlus();
await model!.addAllergies(request, widget.patientInfo, isNoKnown: true);
await model!.getAllergiesVidaPlus(widget.patientInfo);
setState(() {
});
GifLoaderDialogUtils.hideDialog(context);
}
}

Loading…
Cancel
Save