|
|
|
@ -19,8 +19,7 @@ class BloodSugarService extends BaseService {
|
|
|
|
|
hasError = false;
|
|
|
|
|
Map<String, dynamic> body = Map();
|
|
|
|
|
body['isDentalAllowedBackend'] = false;
|
|
|
|
|
await baseAppClient.post(GET_DIABETIC_RESULT_AVERAGE,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
await baseAppClient.post(GET_DIABETIC_RESULT_AVERAGE, onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
monthDiabtectResultAverageList.clear();
|
|
|
|
|
weekDiabtectResultAverageList.clear();
|
|
|
|
|
yearDiabtecResultAverageList.clear();
|
|
|
|
@ -30,18 +29,15 @@ class BloodSugarService extends BaseService {
|
|
|
|
|
yearDiabtecPatientResult.clear();
|
|
|
|
|
|
|
|
|
|
response['List_MonthDiabtectResultAverage'].forEach((item) {
|
|
|
|
|
monthDiabtectResultAverageList
|
|
|
|
|
.add(MonthDiabtectResultAverage.fromJson(item));
|
|
|
|
|
monthDiabtectResultAverageList.add(MonthDiabtectResultAverage.fromJson(item));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
response['List_WeekDiabtectResultAverage'].forEach((item) {
|
|
|
|
|
weekDiabtectResultAverageList
|
|
|
|
|
.add(WeekDiabtectResultAverage.fromJson(item));
|
|
|
|
|
weekDiabtectResultAverageList.add(WeekDiabtectResultAverage.fromJson(item));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
response['List_YearDiabtecResultAverage'].forEach((item) {
|
|
|
|
|
yearDiabtecResultAverageList
|
|
|
|
|
.add(YearDiabtecResultAverage.fromJson(item));
|
|
|
|
|
yearDiabtecResultAverageList.add(YearDiabtecResultAverage.fromJson(item));
|
|
|
|
|
});
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
@ -51,8 +47,7 @@ class BloodSugarService extends BaseService {
|
|
|
|
|
|
|
|
|
|
Future getDiabtecResults() async {
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(GET_DIABTEC_RESULT,
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
await baseAppClient.post(GET_DIABTEC_RESULT, onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
monthDiabtecPatientResult.clear();
|
|
|
|
|
weekDiabtecPatientResult.clear();
|
|
|
|
|
yearDiabtecPatientResult.clear();
|
|
|
|
@ -69,7 +64,6 @@ class BloodSugarService extends BaseService {
|
|
|
|
|
yearDiabtecPatientResult.add(DiabtecPatientResult.fromJson(item));
|
|
|
|
|
});
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: Map());
|
|
|
|
|
}
|
|
|
|
@ -83,9 +77,7 @@ class BloodSugarService extends BaseService {
|
|
|
|
|
body['DiabtecUnit'] = diabtecUnit;
|
|
|
|
|
body['MeasuredTime'] = measuredTime + 1;
|
|
|
|
|
body['isDentalAllowedBackend'] = false;
|
|
|
|
|
await baseAppClient.post(ADD_DIABTEC_RESULT,
|
|
|
|
|
onSuccess: (response, statusCode) async {},
|
|
|
|
|
onFailure: (String error, int statusCode) {
|
|
|
|
|
await baseAppClient.post(ADD_DIABTEC_RESULT, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: body);
|
|
|
|
@ -101,9 +93,7 @@ class BloodSugarService extends BaseService {
|
|
|
|
|
body['isDentalAllowedBackend'] = false;
|
|
|
|
|
body['MeasuredTime'] = measuredTime + 1;
|
|
|
|
|
body['LineItemNo'] = lineItemNo;
|
|
|
|
|
await baseAppClient.post(UPDATE_DIABETIC_RESULT,
|
|
|
|
|
onSuccess: (response, statusCode) async {},
|
|
|
|
|
onFailure: (String error, int statusCode) {
|
|
|
|
|
await baseAppClient.post(UPDATE_DIABETIC_RESULT, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: body);
|
|
|
|
@ -115,9 +105,7 @@ class BloodSugarService extends BaseService {
|
|
|
|
|
Map<String, dynamic> body = Map();
|
|
|
|
|
body['isDentalAllowedBackend'] = false;
|
|
|
|
|
body['To'] = user.emailAddress;
|
|
|
|
|
await baseAppClient.post(SEND_AVERAGE_BLOOD_SUGAR_REPORT,
|
|
|
|
|
onSuccess: (response, statusCode) async {},
|
|
|
|
|
onFailure: (String error, int statusCode) {
|
|
|
|
|
await baseAppClient.post(SEND_AVERAGE_BLOOD_SUGAR_REPORT, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: body);
|
|
|
|
@ -129,9 +117,7 @@ class BloodSugarService extends BaseService {
|
|
|
|
|
Map<String, dynamic> body = Map();
|
|
|
|
|
body['isDentalAllowedBackend'] = false;
|
|
|
|
|
body['LineItemNo'] = lineItemNo;
|
|
|
|
|
await baseAppClient.post(DEACTIVATE_DIABETIC_STATUS,
|
|
|
|
|
onSuccess: (response, statusCode) async {},
|
|
|
|
|
onFailure: (String error, int statusCode) {
|
|
|
|
|
await baseAppClient.post(DEACTIVATE_DIABETIC_STATUS, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: body);
|
|
|
|
|