invokes TouchWorksMagicConstants.ACTION_GET_ENCOUNTER_LIST_FOR_PATIENT action
        :return: JSON response
178911
def save_task_comment(self, task_id, task_comment):
        
        magic = self._magic_json(
            action=TouchWorksMagicConstants.ACTION_SAVE_TASK_COMMENT,
            parameter1=task_id,
            parameter6=task_comment)

        response = self._http_request(TouchWorksEndPoints.MAGIC_JSON, data=magic)
        result = self._get_results_or_raise_if_magic_invalid(
            magic,
            response,
            TouchWorksMagicConstants.RESULT_SAVE_TASK_COMMENT)
        return result
391120
def get_lists(client):
    '''  '''
    response = client.authenticated_request(client.api.Endpoints.LISTS)
    return response.json()
660737
def get_schedule(self, ehr_username, start_date,
                     changed_since, include_pix, other_user='All',
                     end_date='',
                     appointment_types=None, status_filter='All'):
        
        if not start_date:
            raise ValueError('start_date can not be null')
        if end_date:
            start_date = '%s|%s' % (start_date, end_date)
        if not changed_since:
            changed_since = ''
        magic = self._magic_json(action=TouchWorksMagicConstants.ACTION_GET_SCHEDULE,
                                 app_name=self._app_name,
                                 user_id=ehr_username, token=self._token.token,
                                 parameter1=start_date,
                                 parameter2=changed_since,
                                 parameter3=include_pix,
                                 parameter4=other_user,
                                 parameter5=appointment_types,
                                 parameter6=status_filter)
        response = self._http_request(TouchWorksEndPoints.MAGIC_JSON, data=magic)
        result = self._get_results_or_raise_if_magic_invalid(
            magic,
            response,
            TouchWorksMagicConstants.RESULT_GET_SCHEDULE)
        return result
873696
function getCommonActions(device) {
  const actions = []
  actions.push(new BackAction(device))
  actions.push(new HomeAction(device))
  actions.push(new MenuAction(device))

  actions.push()
  return actions
}
1359028
def actions(self):
        
        r = self.session.query(models.Action).all()
        return [x.type_name for x in r]
639156
def save_note(self, note_text, patient_id,
                  document_type,
                  document_status='Unsigned', wrapped_in_rtf='N'):
        
        allowed_document_status = ['Unsigned', 'Final']
        if document_status not in ['Unsigned', 'Final']:
            raise ValueError('document_status was invalid. allowed values are %s' %
                             allowed_document_status)
        magic = self._magic_json(action=TouchWorksMagicConstants.ACTION_SAVE_NOTE,
                                 patient_id=patient_id,
                                 parameter1=note_text,
                                 parameter2=document_type,
                                 parameter3=document_status,
                                 parameter4=wrapped_in_rtf)
        response = self._http_request(TouchWorksEndPoints.MAGIC_JSON, data=magic)
        result = self._get_results_or_raise_if_magic_invalid(
            magic,
            response,
            TouchWorksMagicConstants.RESULT_SAVE_NOTE)
        return result
1054885
def view(self, action, **kwds):
        
        result = self._client.get("/action/%s/view.json" %
                                  self._extract_id(action),
                                  **kwds)["result"]
        return Action(self._client, result)
1170130
def search_task_views(self, user, search_string):
        
        magic = self._magic_json(
            action=TouchWorksMagicConstants.ACTION_SEARCH_TASK_VIEWS,
            parameter1=user,
            parameter2=search_string)

        response = self._http_request(TouchWorksEndPoints.MAGIC_JSON, data=magic)
        result = self._get_results_or_raise_if_magic_invalid(
            magic,
            response,
            TouchWorksMagicConstants.RESULT_SEARCH_TASK_VIEWS)
        return result
1326082
def response_action(self, request, queryset):  # noqa
        
        # There can be multiple action forms on the page (at the top
        # and bottom of the change list, for example). Get the action
        # whose button was pushed.
        try:
            action_index = int(request.POST.get('index', 0))
        except ValueError:  # pragma: no cover
            action_index = 0

        # Construct the action form.
        data = request.POST.copy()
        data.pop(helpers.ACTION_CHECKBOX_NAME, None)
        data.pop("index", None)

        # Use the action whose button was pushed
        try:
            data.update({'action': data.getlist('action')[action_index]})
        except IndexError:  # pragma: no cover
            # If we didn't get an action from the chosen form that's invalid
            # POST data, so by deleting action it'll fail the validation check
            # below. So no need to do anything here
            pass

        action_form = self.action_form(data, auto_id=None)
        action_form.fields['action'].choices = self.get_action_choices(request)

        # If the form's valid we can handle the action.
        if action_form.is_valid():
            action = action_form.cleaned_data['action']
            func, name, description = self.get_actions(request)[action]

            # Get the list of selected PKs. If nothing's selected, we can't
            # perform an action on it, so bail.
            if action_form.cleaned_data['select_across']:
                selected = ALL
            else:
                selected = request.POST.getlist(helpers.ACTION_CHECKBOX_NAME)

            if not selected:
                return None

            revision_field = self.model._concurrencymeta.field

            if self.check_concurrent_action:
                self.delete_selected_confirmation_template = self.get_confirmation_template()

                # If select_across we have to avoid the use of concurrency
                if selected is not ALL:
                    filters = []
                    for x in selected:
                        try:
                            pk, version = x.split(",")
                        except ValueError:  # pragma: no cover
                            raise ImproperlyConfigured('`ConcurrencyActionMixin` error.'
                                                       'A tuple with `primary_key, version_number` '
                                                       'expected:  `%s` found' % x)
                        filters.append(Q(**{'pk': pk,
                                            revision_field.attname: version}))

                    queryset = queryset.filter(reduce(operator.or_, filters))
                    if len(selected) != queryset.count():
                        messages.error(request, 'One or more record were updated. '
                                                '(Probably by other user) '
                                                'The execution was aborted.')
                        return HttpResponseRedirect(".")
                else:
                    messages.warning(request, 'Selecting all records, you will avoid the concurrency check')

            response = func(self, request, queryset)

            # Actions may return an HttpResponse, which will be used as the
            # response from the POST. If not, we'll be a good little HTTP
            # citizen and redirect back to the changelist page.
            if isinstance(response, HttpResponse):
                return response
            else:
                return HttpResponseRedirect(".")
89766
def _make_request(self, action):
        
        if isinstance(action, list):
            kwargs = {'actions': action}
            action = 'send'
        else:
            kwargs = self._get_method_params()

        kwargs.update({
            'consumer_key': self._consumer_key,
            'access_token': self._access_token
        })

        response = requests.post(
            self._get_url(action),
            json=kwargs,
            headers=self._get_headers()
        )

        if response.status_code != requests.codes.ok:
            raise self._make_exception(response)

        return response.json()
669395
def get_patient(self, ehr_username, patient_id):
        
        magic = self._magic_json(
            action=TouchWorksMagicConstants.ACTION_GET_PATIENT_INFO,
            app_name=self._app_name,
            user_id=ehr_username,
            token=self._token.token,
            patient_id=patient_id
        )
        response = self._http_request(TouchWorksEndPoints.MAGIC_JSON, data=magic)
        result = self._get_results_or_raise_if_magic_invalid(
            magic,
            response,
            TouchWorksMagicConstants.RESULT_GET_PATIENT_INFO)
        return result
919386
private ActionList touchActionList() {
        if (contentList != null) {
            if (contentList.isExplicit() || contentList.size() != 1) {
                contentList = null;
            } else {
                ActionList actionList = contentList.get(0);
                if (actionList.isExplicit()) {
                    contentList = null;
                }
            }
        }
        ActionList actionList;
        if (contentList == null) {
            contentList = new ContentList(false);
            actionList = new ActionList(false);
            contentList.add(actionList);
        } else {
            actionList = contentList.get(0);
        }
        return actionList;
    }
1101663
def dispatch(self, *args, **kwargs):
        
        return super(GetAppListJsonView, self).dispatch(*args, **kwargs)
212782
public void getNotifications(Patient patient, Collection<Notification> result) {
        List<String> lst = null;
        result.clear();

        if (patient == null) {
            lst = broker.callRPCList("RGCWXQ ALRLIST", null);
        } else if (patient != null) {
            lst = broker.callRPCList("RGCWXQ ALRLIST", null, patient.getIdElement().getIdPart());
        }

        if (lst != null) {
            for (String item : lst) {
                result.add(new Notification(item));
            }
        }
    }
669129
def get_delegates(self, patient_id):
        
        magic = self._magic_json(
            action=TouchWorksMagicConstants.ACTION_GET_DELEGATES,
            app_name=self._app_name,
            token=self._token.token,
            patient_id=patient_id)
        response = self._http_request(TouchWorksEndPoints.MAGIC_JSON, data=magic)
        result = self._get_results_or_raise_if_magic_invalid(
            magic,
            response,
            TouchWorksMagicConstants.RESULT_GET_DELEGATES)
        return result
1045187
def _push_actions(self):
        
        data = cherrypy.request.json
        with self.app.lock:
            self.app.add_actions(data['actions'], data['scheduler_instance_id'])
995052
def getContacts(self, only_active=True):
        
        contacts = self.objectValues("Contact")
        if only_active:
            contacts = filter(api.is_active, contacts)
        return contacts