def registration_ajax(self, r, **attr):

        T = current.T

        # Load JSON data from request body
        s = r.body
        s.seek(0)
        try:
            data = json.load(s)
        except (ValueError, TypeError):
            r.error(400, current.ERROR.BAD_REQUEST)


        # Initialize processing variables
        output = {}

        error = None

        alert = None
        message = None
        warning = None

        permitted = False
        flags = []

        # Identify the person
        pe_label = data.get("l")
        person = self.get_person(pe_label)

        if person is None:
            error = s3_str(T("No person found with this ID number"))

        else:
            # Get flag info
            flag_info = dvr_get_flag_instructions(person.id,
                                                  action = "id-check",
                                                  )
            permitted = flag_info["permitted"]

            check = data.get("c")
            if check:

                name = s3_fullname(person)
                dob = person.date_of_birth
                if dob:
                    dob = S3DateTime.date_represent(dob)
                    person_data = "%s (%s %s)" % (name, T("Date of Birth"), dob)
                else:
                    person_data = name

                output["p"] = s3_str(person_data)
                output["l"] = person.pe_label

                info = flag_info["info"]
                for flagname, instructions in info:
                    flags.append({"n": s3_str(T(flagname)),
                                  "i": s3_str(T(instructions)),
                                  })
            else:
                event_code = data.get("t")
                if not event_code:
                    alert = T("No event type specified")
                elif not permitted:
                    alert = T("Event registration not permitted")
                else:
                    event_type = self.get_event_type(event_code)
                    if not event_type:
                        alert = T("Invalid event type %s" % event_code)
                    else:
                        success = self.register_event(person.id, event_type.id)
                        if success:
                            message = T("Event registered")
                        else:
                            alert = T("Could not register event")

        # Add messages to output
        if alert:
            output["a"] = s3_str(alert)
        if error:
            output["e"] = s3_str(error)
        if message:
            output["m"] = s3_str(message)
        if warning:
            output["w"] = s3_str(warning)

        # Add flag info to output
        output["s"] = permitted
        output["f"] = flags

        current.response.headers["Content-Type"] = "application/json"
        return json.dumps(output)

    # -------------------------------------------------------------------------
The parameters are taken from the keyword arguments and are specific to
dataset/ETHPy150Open sahana/eden/modules/s3db/dvr.py/DVRRegisterCaseEvent.registration_ajax--crossover with--dataset/ETHPy150Open ARM-software/workload-automation/wlauto/core/device.py/Device.set_runtime_parameters