import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/PatientMuseResultsModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';

class PatientMuseService extends BaseService {
  List<PatientMuseResultsModel> patientMuseResultsModelList = List();

  getECGPatient({int patientType, int patientOutSA,int patientID}) async {
    Map<String,dynamic> body = Map();
    body['PatientType'] = patientType;
    body['PatientOutSA'] = patientOutSA;
    body['PatientID'] = patientID;
    await baseAppClient.post(
      GET_ECG,
      onSuccess: (dynamic response, int statusCode) {
        patientMuseResultsModelList.clear();
        response['HIS_GetPatientMuseResultsList'].forEach((v) {
          patientMuseResultsModelList.add(PatientMuseResultsModel.fromJson(v));
        });
      },
      onFailure: (String error, int statusCode) {
        hasError = true;
        super.error = error;
      },
      body: body,
    );
  }
}
