You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PatientApp-KKUMC/lib/core/service/medical/AllergiesService.dart

26 lines
827 B
Dart

import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/Allergy/Allergy.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class AllergiesService extends BaseService {
List<Allergy> allergies = List();
getAllergies() async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['OutSA'] = 0;
await baseAppClient.post(GET_PATIENT_ALLERGIES,
onSuccess: (response, statusCode) async {
allergies.clear();
response['Patient_Allergies'].forEach((allergy) {
allergies.add(Allergy.fromJson(allergy));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}