<commit_before>'use strict';

angular.module('gpConnect')
        .controller('AppointmentsCreateModalCtrl', function ($state, $scope, $stateParams, $modalInstance, modal, appointmentBookingParams, Appointment, usSpinnerService, gpcResource) {

            $.each(appointmentBookingParams.patient.identifier, function (key, identifier) {
                if (identifier.system == gpcResource.getConst("ID_NHS_NUMBER")) { $scope.patientNhsNumber = identifier.value; }
            });
            $scope.patient = appointmentBookingParams.patient;
            $scope.modal = modal;
            $scope.practitionerName = appointmentBookingParams.practitionerFullName;
            $scope.practiceName = appointmentBookingParams.location.practiceName;
            $scope.locationName = appointmentBookingParams.location.name;

            $scope.appointmentCreate = {};
            $scope.appointmentCreate.resourceType = "Appointment";
            $scope.appointmentCreate.status = "booked";
            $scope.appointmentCreate.type = {
                "coding": [
                    {
                        "system": gpcResource.getConst("VS_C80_PRACTICE_CODES"),
                        "code": appointmentBookingParams.typeCode,
                        "display": appointmentBookingParams.type
                    }
                ],
                "text": appointmentBookingParams.type
            };
            $scope.appointmentCreate.reason = {
                "coding": [
                    {
                        "system": gpcResource.getConst("VS_SNOMED_SCT"),
                        "code": "00001",
                        "display": "Default Appointment Type"
                    }
                ],
                "text": "Generic Booking"
            };
            $scope.appointmentCreate.description = "";
            $scope.appointmentCreate.start = appointmentBookingParams.startTime;
            $scope.appointmentCreate.end = appointmentBookingParams.endTime;
            
            $scope.appointmentCreate.slot = [];
            for(var slotIndex = 0; slotIndex < appointmentBookingParams.slotIds.length; slotIndex++){
                var reference = {"reference": "Slot/" + appointmentBookingParams.slotIds[slotIndex]};
                $scope.appointmentCreate.slot.push(reference);
            }
            
            $scope.appointmentCreate.comment = "";
            $scope.appointmentCreate.participant = [
                {
                    "actor": {
                        "reference": "Patient/" + appointmentBookingParams.patientFhirId
                    },
                    "status": "accepted"
                },
                {
                    "actor": {
                        "reference": "Practitioner/" + appointmentBookingParams.practitionerId
                    },
                    "status": "accepted"
                },
                {
                    "actor": {
                        "reference": "Location/" + appointmentBookingParams.locationId
                    },
                    "status": "accepted"
                }
            ];

            $scope.ok = function (appointmentCreateForm) {<commit_msg>Front end change to allow appointment  book to work<commit_after>'use strict';

angular.module('gpConnect')
        .controller('AppointmentsCreateModalCtrl', function ($state, $scope, $stateParams, $modalInstance, modal, appointmentBookingParams, Appointment, usSpinnerService, gpcResource) {


            $.each(appointmentBookingParams.patient.identifier, function (key, identifier) {
            if (identifier.system == gpcResource.getConst("ID_NHS_NUMBER")) { $scope.patientNhsNumber = identifier.value; }

            });
            $scope.patient = appointmentBookingParams.patient;
            $scope.modal = modal;
            $scope.practitionerName = appointmentBookingParams.practitionerFullName;
            $scope.practiceName = appointmentBookingParams.location.practiceName;
            $scope.locationName = appointmentBookingParams.location.name;

            $scope.appointmentCreate = {};
            $scope.appointmentCreate.resourceType = "Appointment";
            $scope.appointmentCreate.status = "booked";
            $scope.appointmentCreate.type = {
                "coding": [
                    {
                        "system": gpcResource.getConst("VS_C80_PRACTICE_CODES"),
                        "code": appointmentBookingParams.typeCode,
                        "display": appointmentBookingParams.type
                    }
                ],
                "text": appointmentBookingParams.type
            };
            $scope.appointmentCreate.reason = {
                "coding": [
                    {
                        "system": gpcResource.getConst("VS_SNOMED_SCT"),
                        "code": "00001",
                        "display": "Default Appointment Type"
                    }
                ],
                "text": "Generic Booking"
            };
           
            $scope.appointmentCreate.start = appointmentBookingParams.startTime;
            $scope.appointmentCreate.end = appointmentBookingParams.endTime;
            
            $scope.appointmentCreate.slot = [];
            for(var slotIndex = 0; slotIndex < appointmentBookingParams.slotIds.length; slotIndex++){
                var reference = {"reference": "Slot/" + appointmentBookingParams.slotIds[slotIndex]};
                $scope.appointmentCreate.slot.push(reference);
            }
            
            $scope.appointmentCreate.comment;
            $scope.appointmentCreate.participant = [
                {
                    "actor": {
                        "reference": "Patient/" + appointmentBookingParams.patientFhirId
                    },
                    "status": "accepted"
                },
                {
                    "actor": {
                        "reference": "Practitioner/" + appointmentBookingParams.practitionerId
                    },
                    "status": "accepted"
                },
                {
                    "actor": {
                        "reference": "Location/" + appointmentBookingParams.locationId
                    },
                    "status": "accepted"
                }
            ];

            $scope.ok = function (appointmentCreateForm) {
{'fraction_non_alphanumeric': 0.10106382978723404, 'fraction_numerical': 0.0025031289111389237, 'mean_word_length': 1.5199054000788332, 'pattern_counts': {'":': 40, '<': 5, '<?xml version=': 0, '>': 3, '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': '529914', 'n_tokens_mistral': 1562, 'n_tokens_neox': 1454, 'n_words': 211}