<commit_before>(function () {
    'use strict';

    angular.module('app')
        .service('HttpService', ['$http',
            HttpService
        ]);

    function HttpService($http) {

//      'POST recovery' => 'user/recovery/request',
//      'OPTIONS recovery' => 'user/recovery/options',
//      'PUT user/password' => 'user/recovery/recover',
        this.postRecovery = function (recovery_email) {
            return $http({
                method: "POST",
                url: 'http://api.cardiacare.ru/recovery',
                data: {
                    email: recovery_email
                }
            })
                .then(function (response) {
                        // success
                    },
                    function (response) { // optional
                        // failed
                    });
        };

        this.putRecovery = function (recovery) {
            return $http({
                method: "PUT",
                url: 'http://api.cardiacare.ru/user/password',
                data: recovery
            })
                .then(function (response) {
                        throw new Error('blablabla1');
                    },
                    function (response) { // optional
                        throw new Error('blablabla');
                    });
        };


//      'GET patients' => 'emr/patient/index',
//      'OPTIONS patients' => 'emr/patient/options',
//      'GET patients/<id:\d+>' => 'emr/patient/view',
//      'PUT patients/<id:\d+>' => 'emr/patient/update',
//      'DELETE patients/<id:\d+>' => 'emr/patient/delete',
//      'OPTIONS patients/<id:\d+>' => 'emr/patient/options',

        this.getPatientList = function () {
            return $http({
                method: 'GET',
                url: 'http://api.cardiacare.ru/patients',
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json'
                }
            }).then(function (response) {
                return response.data;
            }, function () {
                alert("error");
                return null;
            });

        };

        this.getPatientById = function (patient_id) {
            return $http({
                method: 'GET',
                url: 'http://api.cardiacare.ru/patients',
                params: {id: patient_id},
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json'
                }
            }).then(function (response) {
                console.log(response);
                return response.data;
            }, function () {
                alert("error");
                return null;
            });

        };

        this.putPatientById = function (patient) {
            return $http({
                method: "PUT",
                url: 'http://api.cardiacare.ru/patients',
                data: patient
            })
                .then(function (response) {
                        // success
                    },
                    function (response) { // optional
                        // failed
                    });
        };

        this.deletePatientById = function (patient_id) {
            return $http({
                method: "Delete",
                url: 'http://api.cardiacare.ru/patients',
                params: {id: patient_id}
            }).then(function (response) {
                    alert("success");
                },
                function (response) {
                    alert("error");
                });
        };

//        'POST invites' => 'user/invite/create',
//        'OPTIONS invites' => 'user/invite/options',
//        'GET invites' => 'user/invite/index',
//        'GET invites/<id:\d+>' => 'user/invite/view',

        this.postInvite = function (invite) {
            return $http({
                method: "POST",
                url: 'http://api.cardiacare.ru/invites',
                data: invite
            }).then(function (response) {
                    // success
                },
                function (response) { // optional
                    // failed
                });
        };

        this.getInvitesList = function () {
            return $http({
                method: 'GET',
                url: 'http://api.cardiacare.ru/invites',
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json'
                }
            }).then(function (data) {
                return data;
            }, function () {
                alert("error");
                return null;
            });
        };

        this.getInviteById = function (invite_id) {
            return $http({
                method: 'GET',
                url: 'http://api.cardiacare.ru/invites',
                params: {id: invite_id},
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json'
                }
            }).then(function (response) {
                return response.data;
            }, function () {
                alert("error");
                return null;
            });
        };


//        'POST survey' => 'survey/questionnaire/create',
//        'OPTIONS survey' => 'survey/questionnaire/options',
//        'GET survey' => 'survey/questionnaire/index',
//        'GET survey/<id:\d+>' => 'survey/questionnaire/view',
//        'OPTIONS survey/<id:\d+>' => 'survey/questionnaire/options',
//        'DELETE survey/<id:\d+>' => 'survey/questionnaire/delete'
        this.postSurvey = function (survey) {
            return $http({
                method: "POST",
                url: 'http://api.cardiacare.ru/survey',
                data: survey
            }).then(function (response) {
                    // success
                },
                function (response) { // optional
                    // failed
                });
        };

        this.getServeyList = function () {
            return $http({
                method: 'GET',
                url: 'http://api.cardiacare.ru/servey',
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json'
                }
            }).then(function (response) {
                return response.data;
            }, function () {
                alert("error");
                return null;
            });
        };

        this.getServeyById = function (servey_id) {
            return $http({
                method: 'GET',
                url: 'http://api.cardiacare.ru/servey',
                params: {id: servey_id},
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json'
                }
            }).then(function (response) {
                return response.data;
            }, function () {
                alert("error");
                return null;
            });
        };

        this.deleteServeyById = function (servey_id) {
            return $http({
                method: "Delete",
                url: 'http://api.cardiacare.ru/servey',
                params: {id: servey_id}
            }).then(function (response) {
                    // success
                },
                function (response) { // optional
                    // failed
                });
        };


//        'POST feedback' => 'survey/feedback/create',
//        'OPTIONS feedback' => 'survey/feedback/options',
//        'GET feedback' => 'survey/feedback/index',
//        'GET feedback/<id:\d+>' => 'survey/feedback/view',
//        'OPTIONS feedback/<id:\d+>' => 'survey/feedback/options',
//        'DELETE feedback/<id:\d+>' => 'survey/feedback/delete'
        this.postFeedback = function (feedback) {
            return $http({
                method: "POST",
                url: 'http://api.cardiacare.ru/feedback',
                data: feedback
            }).then(function (response) {
                    // success
                },
                function (response) { // optional
                    // failed
                });
        };

        this.getFeedbackList = function (patientId) {
            return $http({
                method: 'GET',
                url: 'http://api.cardiacare.ru/feedback/' + patientId,
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json'
                }
            }).then(function (response) {
                return response.data;
            }, function () {
                alert("error");<commit_msg>feedback<commit_after>(function () {
    'use strict';

    angular.module('app')
        .service('HttpService', ['$http',
            HttpService
        ]);

    function HttpService($http) {

//      'POST recovery' => 'user/recovery/request',
//      'OPTIONS recovery' => 'user/recovery/options',
//      'PUT user/password' => 'user/recovery/recover',
        this.postRecovery = function (recovery_email) {
            return $http({
                method: "POST",
                url: 'http://api.cardiacare.ru/recovery',
                data: {
                    email: recovery_email
                }
            })
                .then(function (response) {
                        // success
                    },
                    function (response) { // optional
                        // failed
                    });
        };

        this.putRecovery = function (recovery) {
            return $http({
                method: "PUT",
                url: 'http://api.cardiacare.ru/user/password',
                data: recovery
            })
                .then(function (response) {
                        throw new Error('blablabla1');
                    },
                    function (response) { // optional
                        throw new Error('blablabla');
                    });
        };


//      'GET patients' => 'emr/patient/index',
//      'OPTIONS patients' => 'emr/patient/options',
//      'GET patients/<id:\d+>' => 'emr/patient/view',
//      'PUT patients/<id:\d+>' => 'emr/patient/update',
//      'DELETE patients/<id:\d+>' => 'emr/patient/delete',
//      'OPTIONS patients/<id:\d+>' => 'emr/patient/options',

        this.getPatientList = function () {
            return $http({
                method: 'GET',
                url: 'http://api.cardiacare.ru/patients',
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json'
                }
            }).then(function (response) {
                return response.data;
            }, function () {
                alert("error");
                return null;
            });

        };

        this.getPatientById = function (patient_id) {
            return $http({
                method: 'GET',
                url: 'http://api.cardiacare.ru/patients',
                params: {id: patient_id},
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json'
                }
            }).then(function (response) {
                console.log(response);
                return response.data;
            }, function () {
                alert("error");
                return null;
            });

        };

        this.putPatientById = function (patient) {
            return $http({
                method: "PUT",
                url: 'http://api.cardiacare.ru/patients',
                data: patient
            })
                .then(function (response) {
                        // success
                    },
                    function (response) { // optional
                        // failed
                    });
        };

        this.deletePatientById = function (patient_id) {
            return $http({
                method: "Delete",
                url: 'http://api.cardiacare.ru/patients',
                params: {id: patient_id}
            }).then(function (response) {
                    alert("success");
                },
                function (response) {
                    alert("error");
                });
        };

//        'POST invites' => 'user/invite/create',
//        'OPTIONS invites' => 'user/invite/options',
//        'GET invites' => 'user/invite/index',
//        'GET invites/<id:\d+>' => 'user/invite/view',

        this.postInvite = function (invite) {
            return $http({
                method: "POST",
                url: 'http://api.cardiacare.ru/invites',
                data: invite
            }).then(function (response) {
                    // success
                },
                function (response) { // optional
                    // failed
                });
        };

        this.getInvitesList = function () {
            return $http({
                method: 'GET',
                url: 'http://api.cardiacare.ru/invites',
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json'
                }
            }).then(function (data) {
                return data;
            }, function () {
                alert("error");
                return null;
            });
        };

        this.getInviteById = function (invite_id) {
            return $http({
                method: 'GET',
                url: 'http://api.cardiacare.ru/invites',
                params: {id: invite_id},
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json'
                }
            }).then(function (response) {
                return response.data;
            }, function () {
                alert("error");
                return null;
            });
        };


//        'POST survey' => 'survey/questionnaire/create',
//        'OPTIONS survey' => 'survey/questionnaire/options',
//        'GET survey' => 'survey/questionnaire/index',
//        'GET survey/<id:\d+>' => 'survey/questionnaire/view',
//        'OPTIONS survey/<id:\d+>' => 'survey/questionnaire/options',
//        'DELETE survey/<id:\d+>' => 'survey/questionnaire/delete'
        this.postSurvey = function (survey) {
            return $http({
                method: "POST",
                url: 'http://api.cardiacare.ru/survey',
                data: survey
            }).then(function (response) {
                    // success
                },
                function (response) { // optional
                    // failed
                });
        };

        this.getServeyList = function () {
            return $http({
                method: 'GET',
                url: 'http://api.cardiacare.ru/servey',
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json'
                }
            }).then(function (response) {
                return response.data;
            }, function () {
                alert("error");
                return null;
            });
        };

        this.getServeyById = function (servey_id) {
            return $http({
                method: 'GET',
                url: 'http://api.cardiacare.ru/servey',
                params: {id: servey_id},
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json'
                }
            }).then(function (response) {
                return response.data;
            }, function () {
                alert("error");
                return null;
            });
        };

        this.deleteServeyById = function (servey_id) {
            return $http({
                method: "Delete",
                url: 'http://api.cardiacare.ru/servey',
                params: {id: servey_id}
            }).then(function (response) {
                    // success
                },
                function (response) { // optional
                    // failed
                });
        };


//        'POST feedback' => 'survey/feedback/create',
//        'OPTIONS feedback' => 'survey/feedback/options',
//        'GET feedback' => 'survey/feedback/index',
//        'GET feedback/<id:\d+>' => 'survey/feedback/view',
//        'OPTIONS feedback/<id:\d+>' => 'survey/feedback/options',
//        'DELETE feedback/<id:\d+>' => 'survey/feedback/delete'
        this.postFeedback = function (feedback) {
            return $http({
                method: "POST",
                url: 'http://api.cardiacare.ru/feedback',
                data: feedback
            }).then(function (response) {
                    // success
                },
                function (response) { // optional
                    // failed
                });
        };

        this.getFeedbackList = function (patientId) {
            return $http({
                method: 'GET',
                url: 'http://api.cardiacare.ru/patients/' + patientId + '/feedback',
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json'
                }
            }).then(function (response) {
                return response.data;
            }, function () {
                alert("error");
{'fraction_non_alphanumeric': 0.13917789527545626, 'fraction_numerical': 0.00011370743078060151, 'mean_word_length': 1.0880816714150048, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3821481', 'n_tokens_mistral': 4588, 'n_tokens_neox': 4231, 'n_words': 788}