import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryReqModel.dart';
import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryResModel.dart';

class VteAssessmentService extends BaseService {

  List<VteAssessmentResponseModel> _allVteHistoryList = [];

  List<VteAssessmentResponseModel> get allVteHistoryList =>
      _allVteHistoryList;
  Future getVteAssessment(
      {VteAssessmentRequestModel? vteAssessmentRequestModel}) async {
    hasError = false;
    await baseAppClient.post(VTE_ASSESSMENT,
        onSuccess: (dynamic response, int statusCode) {
      _allVteHistoryList.clear();
      response['INP_VTEHistoryByTransactionNo_List'].forEach(
        (v) {
          _allVteHistoryList.add(VteAssessmentResponseModel.fromJson(v));
        },
      );
    }, onFailure: (String error, int statusCode) {
      hasError = true;
      super.error = error;
    }, body: vteAssessmentRequestModel!.toJson());
  }
}
