text:
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/notifications/win/notification_template_builder.h"

#include <memory>
#include <string>

#include "base/macros.h"
#include "base/strings/string16.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "chrome/browser/notifications/win/fake_notification_image_retainer.h"
#include "chrome/browser/notifications/win/notification_launch_id.h"
#include "chrome/common/chrome_features.h"
#include "chrome/grit/chromium_strings.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/message_center/public/cpp/notification.h"

using message_center::Notification;
using message_center::NotifierId;
using message_center::RichNotificationData;

namespace {

const char kContextMenuLabel[] = "settings";
const char kEncodedId[] = "0|0|Default|0|https://example.com/|notification_id";
const char kNotificationId[] = "notification_id";
const char kNotificationTitle[] = "My Title";
const char kNotificationMessage[] = "My Message";
const char kNotificationOrigin[] = "https://example.com";

base::Time FixedTime() {
  base::Time time;
  base::Time::Exploded exploded = {0};
  exploded.year = 1998;
  exploded.month = 9;
  exploded.day_of_month = 4;
  exploded.hour = 1;
  exploded.minute = 2;
  exploded.second = 3;
  EXPECT_TRUE(base::Time::FromUTCExploded(exploded, &time));
  return time;
}

}  // namespace

class NotificationTemplateBuilderTest : public ::testing::Test {
 public:
  NotificationTemplateBuilderTest() = default;
  ~NotificationTemplateBuilderTest() override = default;

  void SetUp() override { SetContextMenuLabelForTesting(kContextMenuLabel); }

  void TearDown() override { SetContextMenuLabelForTesting(nullptr); }

 protected:
  // Builds a notification object and initializes it to default values.
  message_center::Notification BuildNotification() {
    GURL origin_url(kNotificationOrigin);
    message_center::Notification notification(
        message_center::NOTIFICATION_TYPE_SIMPLE, kNotificationId,
        base::UTF8ToUTF16(kNotificationTitle),
        base::UTF8ToUTF16(kNotificationMessage), gfx::Image() /* icon */,
        base::string16() /* display_source */, origin_url,
        NotifierId(origin_url), RichNotificationData(), nullptr /* delegate */);
    // Set a fixed timestamp, to avoid having to test against current timestamp.
    notification.set_timestamp(FixedTime());
    notification.set_settings_button_handler(
        message_center::SettingsButtonHandler::DELEGATE);
    return notification;
  }

  // Converts the notification data to XML and verifies it is as expected. Calls
  // must be wrapped in ASSERT_NO_FATAL_FAILURE().
  void VerifyXml(const message_center::Notification& notification,
                 const base::string16& expected_xml_template) {
    FakeNotificationImageRetainer image_retainer;
    NotificationLaunchId launch_id(kEncodedId);
    base::string16 xml_template =
        BuildNotificationTemplate(&image_retainer, launch_id, notification);
    EXPECT_EQ(xml_template, expected_xml_template);
  }

  base::test::TaskEnvironment task_environment_;

 private:
  DISALLOW_COPY_AND_ASSIGN(NotificationTemplateBuilderTest);
};

TEST_F(NotificationTemplateBuilderTest, SimpleToast) {
  message_center::Notification notification = BuildNotification();

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
   <text placement="attribution">example.com</text>
  </binding>
 </visual>
 <actions>
  <action content="settings" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}

TEST_F(NotificationTemplateBuilderTest, Buttons) {
  message_center::Notification notification = BuildNotification();

  std::vector<message_center::ButtonInfo> buttons;
  buttons.emplace_back(base::ASCIIToUTF16("Button1"));
  buttons.emplace_back(base::ASCIIToUTF16("Button2"));
  notification.set_buttons(buttons);

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
   <text placement="attribution">example.com</text>
  </binding>
 </visual>
 <actions>
  <action activationType="foreground" content="Button1" arguments="1|0|0|Default|0|https://example.com/|notification_id"/>
  <action activationType="foreground" content="Button2" arguments="1|1|0|Default|0|https://example.com/|notification_id"/>
  <action content="settings" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}

TEST_F(NotificationTemplateBuilderTest, InlineReplies) {
  message_center::Notification notification = BuildNotification();

  std::vector<message_center::ButtonInfo> buttons;
  message_center::ButtonInfo button1(base::ASCIIToUTF16("Button1"));
  button1.placeholder = base::ASCIIToUTF16("Reply here");
  buttons.emplace_back(button1);
  buttons.emplace_back(base::ASCIIToUTF16("Button2"));
  notification.set_buttons(buttons);

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
   <text placement="attribution">example.com</text>
  </binding>
 </visual>
 <actions>
  <input id="userResponse" type="text" placeHolderContent="Reply here"/>
  <action activationType="foreground" content="Button1" arguments="1|0|0|Default|0|https://example.com/|notification_id"/>
  <action activationType="foreground" content="Button2" arguments="1|1|0|Default|0|https://example.com/|notification_id"/>
  <action content="settings" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}

TEST_F(NotificationTemplateBuilderTest, InlineRepliesDoubleInput) {
  message_center::Notification notification = BuildNotification();

  std::vector<message_center::ButtonInfo> buttons;
  message_center::ButtonInfo button1(base::ASCIIToUTF16("Button1"));
  button1.placeholder = base::ASCIIToUTF16("Reply here");
  buttons.emplace_back(button1);
  message_center::ButtonInfo button2(base::ASCIIToUTF16("Button2"));
  button2.placeholder = base::ASCIIToUTF16("Should not appear");
  buttons.emplace_back(button2);
  notification.set_buttons(buttons);

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
   <text placement="attribution">example.com</text>
  </binding>
 </visual>
 <actions>
  <input id="userResponse" type="text" placeHolderContent="Reply here"/>
  <action activationType="foreground" content="Button1" arguments="1|0|0|Default|0|https://example.com/|notification_id"/>
  <action activationType="foreground" content="Button2" arguments="1|1|0|Default|0|https://example.com/|notification_id"/>
  <action content="settings" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}

TEST_F(NotificationTemplateBuilderTest, InlineRepliesTextTypeNotFirst) {
  message_center::Notification notification = BuildNotification();

  std::vector<message_center::ButtonInfo> buttons;
  buttons.emplace_back(base::ASCIIToUTF16("Button1"));
  message_center::ButtonInfo button2(base::ASCIIToUTF16("Button2"));
  button2.placeholder = base::ASCIIToUTF16("Reply here");
  buttons.emplace_back(button2);
  notification.set_buttons(buttons);

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
   <text placement="attribution">example.com</text>
  </binding>
 </visual>
 <actions>
  <input id="userResponse" type="text" placeHolderContent="Reply here"/>
  <action activationType="foreground" content="Button1" arguments="1|0|0|Default|0|https://example.com/|notification_id"/>
  <action activationType="foreground" content="Button2" arguments="1|1|0|Default|0|https://example.com/|notification_id"/>
  <action content="settings" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}

TEST_F(NotificationTemplateBuilderTest, Silent) {
  message_center::Notification notification = BuildNotification();
  notification.set_silent(true);

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
   <text placement="attribution">example.com</text>
  </binding>
 </visual>
 <actions>
  <action content="settings" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
 <audio silent="true"/>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}

TEST_F(NotificationTemplateBuilderTest, RequireInteraction) {
  message_center::Notification notification = BuildNotification();

  std::vector<message_center::ButtonInfo> buttons;
  buttons.emplace_back(base::ASCIIToUTF16("Button1"));
  notification.set_buttons(buttons);
  notification.set_never_timeout(true);

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" scenario="reminder" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
   <text placement="attribution">example.com</text>
  </binding>
 </visual>
 <actions>
  <action activationType="foreground" content="Button1" arguments="1|0|0|Default|0|https://example.com/|notification_id"/>
  <action content="settings" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}

TEST_F(NotificationTemplateBuilderTest, RequireInteractionSuppressed) {
  base::test::ScopedFeatureList scoped_feature_list;
  scoped_feature_list.InitAndEnableFeature(
      features::kNotificationDurationLongForRequireInteraction);

  message_center::Notification notification = BuildNotification();
  notification.set_never_timeout(true);

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" duration="long" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
   <text placement="attribution">example.com</text>
  </binding>
 </visual>
 <actions>
  <action content="settings" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}

TEST_F(NotificationTemplateBuilderTest, NullTimestamp) {
  message_center::Notification notification = BuildNotification();
  notification.set_timestamp(base::Time());

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
   <text placement="attribution">example.com</text>
  </binding>
 </visual>
 <actions>
  <action content="settings" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}

TEST_F(NotificationTemplateBuilderTest, LocalizedContextMenu) {
  message_center::Notification notification = BuildNotification();

  // Disable overriding context menu label.
  SetContextMenuLabelForTesting(nullptr);

  const wchar_t kExpectedXmlTemplate[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
   <text placement="attribution">example.com</text>
  </binding>
 </visual>
 <actions>
  <action content="%ls" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
</toast>
)";

  base::string16 settings_msg = l10n_util::GetStringUTF16(
      IDS_WIN_NOTIFICATION_SETTINGS_CONTEXT_MENU_ITEM_NAME);
  base::string16 expected_xml =
      base::StringPrintf(kExpectedXmlTemplate, settings_msg.c_str());

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, expected_xml));
}

TEST_F(NotificationTemplateBuilderTest, Images) {
  message_center::Notification notification = BuildNotification();

  SkBitmap icon;
  icon.allocN32Pixels(64, 64);
  icon.eraseARGB(255, 100, 150, 200);

  notification.set_icon(gfx::Image::CreateFrom1xBitmap(icon));
  notification.set_image(gfx::Image::CreateFrom1xBitmap(icon));

  std::vector<message_center::ButtonInfo> buttons;
  message_center::ButtonInfo button(base::ASCIIToUTF16("Button1"));
  button.placeholder = base::ASCIIToUTF16("Reply here");
  button.icon = gfx::Image::CreateFrom1xBitmap(icon);
  buttons.emplace_back(button);
  notification.set_buttons(buttons);

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
   <text placement="attribution">example.com</text>
   <image placement="appLogoOverride" src="c:\temp\img0.tmp" hint-crop="none"/>
   <image placement="hero" src="c:\temp\img1.tmp"/>
  </binding>
 </visual>
 <actions>
  <input id="userResponse" type="text" placeHolderContent="Reply here"/>
  <action activationType="foreground" content="Button1" arguments="1|0|0|Default|0|https://example.com/|notification_id" imageUri="c:\temp\img2.tmp"/>
  <action content="settings" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}

TEST_F(NotificationTemplateBuilderTest, ContextMessage) {
  message_center::Notification notification = BuildNotification();

  notification.set_context_message(L"context_message");

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
   <text placement="attribution">context_message</text>
  </binding>
 </visual>
 <actions>
  <action content="settings" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}

TEST_F(NotificationTemplateBuilderTest, ExtensionNoContextMessage) {
  message_center::Notification notification = BuildNotification();

  // Explicitly not setting context message to ensure attribution is not added.
  // Explicitly set origin url to something non http/https to ensure that origin
  // is not used as attribution.
  notification.set_origin_url(
      GURL("chrome-extension://bfojpkhoiegeigfifhdnbeobmhlahdle/"));

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
  </binding>
 </visual>
 <actions>
  <action content="settings" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}

TEST_F(NotificationTemplateBuilderTest, ProgressBar) {
  message_center::Notification notification = BuildNotification();

  notification.set_type(message_center::NOTIFICATION_TYPE_PROGRESS);
  notification.set_progress(30);

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
   <text placement="attribution">example.com</text>
   <progress status="" value="0.30"/>
  </binding>
 </visual>
 <actions>
  <action content="settings" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}

TEST_F(NotificationTemplateBuilderTest, ProgressBar_Indeterminate) {
  message_center::Notification notification = BuildNotification();

  notification.set_type(message_center::NOTIFICATION_TYPE_PROGRESS);
  // Setting the progress outside the [0-100] range should result in an
  // indeterminate progress notification.
  notification.set_progress(-1);

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
   <text placement="attribution">example.com</text>
   <progress status="" value="indeterminate"/>
  </binding>
 </visual>
 <actions>
  <action content="settings" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}

TEST_F(NotificationTemplateBuilderTest, ListEntries) {
  message_center::Notification notification = BuildNotification();

  notification.set_type(message_center::NOTIFICATION_TYPE_MULTIPLE);
  std::vector<message_center::NotificationItem> items;
  items.push_back({L"title1", L"message1"});
  items.push_back({L"title2", L"message2"});
  items.push_back({L"title3", L"message3"});
  items.push_back({L"title4", L"message4"});
  items.push_back({L"title5", L"message5"});  // Will be truncated.
  notification.set_items(items);

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>title1 - message1
title2 - message2
title3 - message3
title4 - message4
</text>
   <text placement="attribution">example.com</text>
  </binding>
 </visual>
 <actions>
  <action content="settings" placement="contextMenu" activationType="foreground" arguments="2|0|Default|0|https://example.com/|notification_id"/>
 </actions>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}

TEST_F(NotificationTemplateBuilderTest, NoSettings) {
  message_center::Notification notification = BuildNotification();

  // Disable overriding context menu label.
  SetContextMenuLabelForTesting(nullptr);

  notification.set_settings_button_handler(
      message_center::SettingsButtonHandler::NONE);

  const wchar_t kExpectedXml[] =
      LR"(<toast launch="0|0|Default|0|https://example.com/|notification_id" displayTimestamp="1998-09-04T01:02:03Z">
 <visual>
  <binding template="ToastGeneric">
   <text>My Title</text>
   <text>My Message</text>
   <text placement="attribution">example.com</text>
  </binding>
 </visual>
 <actions/>
</toast>
)";

  ASSERT_NO_FATAL_FAILURE(VerifyXml(notification, kExpectedXml));
}


text:
Upon Closer Inspection…
By Annie Macios
By implementing a chart auditing program, healthcare organizations can rest easier knowing their documentation is receiving the once-over.
Lately, many healthcare facilities and physician practices are borrowing a mantra from the Boy Scouts handbook: Be prepared.
Chart auditing programs have become more important in light of an increase in federal payer audits. As a result, many physicians and health systems want assurance their documentation will withstand scrutiny, while others seek a refresher in best practices. A strong internal chart auditing program can help ensure sound documentation, making it easier for healthcare organizations to capture missed revenue and improve patient care.
Audrey Howard, RHIA, a senior consultant with 3M Health Information Systems, believes chart auditing is important on several levels. "It used to be that chart auditing was done to evaluate DRG [diagnosis-related group] issues that could lead to incorrect coding and reimbursement, but now audits are used to make sure everyone is in compliance and that records are coded in a way that can withstand an external audit," she says.
Likening coding to the tale of "Goldilocks and the Three Bears," Howard says the results should be "not too much [overcoding], not too little [undercoding], but just right," adding that a successful chart auditing program incorporates consistency, accountability, and the ability to track information.
One major goal of an internal audit is to educate coders on performance levels, Howard says. The results can offer coding managers clues to areas where the department may be falling short.
"For an internal audit, audit a consistent sample of each coder's work. Then you can review the audit results on a monthly basis and track and trend findings. Sometimes you might find problems with a particular coder or the same mistakes occurring across the board for one particular DRG. By knowing what the problem is, it makes it easier to tailor education and provide support to correct those problems," says Howard.
In addition to a sampling of each coder's work, facilities can perform focused reviews of specific DRGs. During this process, internal auditors focus on a specific DRG on a prebill basis, search for inconsistencies, and track and trend results. Howard says an audit should also contain random DRGs, records, length of stay, and patient types for review.
Kathy Johnson, RHIA, vice president of coding quality and compliance services at Care Communications, says chart auditing examines not only coding practices but also interface issues associated with the interoperability of a facility's software application, which impacts quality of care, patient satisfaction, and revenue. Being receptive to reviewing areas beyond coding helps a facility receive a better return on investment from its chart auditing program, she adds.
For example, attending physicians may visit patients twice in the hospital. Plus, hospitalists may see the patient a couple times. "That is four visits for stable patients. Something like that may be identified in a review process with an impact on patient care as well as revenue," Johnson says.
She adds that it is important to examine the consistency of medical records for not only what information is included but also to ensure they are filed in the same place so they are accessible across the continuum of care. For example, patient care can be affected if diagnostic test results are not recorded in a timely manner and kept in a location that offers clinicians easy access.
When Johnson conducts an inpatient client review, it features a full chart audit, including documentation and coding, plus a check on the present-on-admission indicator. The accuracy of that indicator, she says, will often determine whether the chart accurately reflects the patient story as well as proper reimbursement.
Physician education is another key to success. Howard suggests physician querying should be a part of the chart auditing process. "Having a query process in place is very important, and it should include a retrospective query process and possibly a concurrent query as well. Getting the query to the physician to obtain clarification prior to final coding is key," she notes.
Howard also recommends creating a set of audit policies and procedures to help ensure compliance. "That way you can track information, making everyone accountable for the work they do, which will ensure consistency throughout the process," she says.
In regard to improving patient care via chart audits, Howard believes a concurrent review program makes the most sense. Anyone reviewing the record across the continuum of care can recommend and address issues that surface while the patient is still in the hospital.
While maximizing reimbursement remains the main driver behind the implementation of chart auditing programs, many facilities are becoming increasingly concerned with compliance issues and whether physician documentation supports a DRG.
One advantage of having an internal review process is that it allows a facility or a physician to self-report and correct any documentation that might be lacking. On the other hand, an external review boasts the objectivity of a third-party evaluation. "Having both allows for greater preparedness for when an external payer auditor comes in. The expectation is that the review must be thorough," says Johnson.
The arrival of recovery audit contractors (RACs) has put more emphasis on preparedness as the frequency of reviews has intensified, with greater attention being paid to chart audits. "The breadth of the [RAC] review is pretty expansive, but it also allows people to say, 'We have been able to rectify ourselves.' It isn't a matter of if a RAC will review but when. It's just a part of the way we conduct business today," Johnson says, adding that external auditors are looking at not only whether a facility has a program in place but also how effective it is.
For Physician Practices
Johnson says chart auditing is approached differently in a physician practice compared with a hospital setting. In a physician office, reviewers work more closely with the provider whereas in a hospital they are also working with other departments that support the clinician. For example, a hospital coding department will receive feedback as will HIM staff if it involves an interoperability issue.
Feedback is an essential element of the audit process in physician practices, Johnson says. "In a physician's office, you can interact directly with the provider and have the opportunity to look at things very objectively and share that with the physician," she notes. "It is always nice if you do a review where you discover they're doing a good job and you can really reinforce their practices and make sure they are maintaining that performance."
Peggy Stilley, CPC, CPMA, director of audit services with AAPC Physician Services, an affiliation of AAPC, works with physicians and other providers to analyze whether the documentation of evaluation and management (E/M) services, and surgical and office procedures meets established guidelines, including those of Medicare and Medicaid.
"I compare what the practice billed with what the provider has in the record, looking at documentation guidelines and the nature of the patient's presenting problem compared to what should have been billed by the provider," she says.
Stilley says an audit can determine where the physician is falling short in terms of documentation or whether cases are being overdocumented based on the complexity of a patient's condition. "For example, if a patient presented with a problem with low complexity, you could not support the service with a high level of documentation because it is not considered medically necessary," she explains. "Conversely, if there is moderate complexity and the physician fails to document adequate history and/or exam, he's not able to bill the higher level of service."
The key components of E/M services are history, exam, and complexity of decision making. "Providers have an idea going into the encounter of its complexity and must capture adequate details in the documentation to bill appropriately," says Stilley. "If it isn't documented, you cannot prove the service was provided."
A chart audit can have implications for patient care standards. Examining the patient based on how he or she presents, whether the encounter was dated and signed by a physician, adequate documentation of the procedure, identifying the location of service, and the patient's status when sent to recovery are all important chart elements that can affect care.
After conducting an audit, Stilley provides a detailed report based on CPT guidelines and documentation standards. She also schedules a review to evaluate the findings and discuss the results with the provider. "Most physicians understand and want to be accurate in their documentation and are receptive to it and will say, 'I did x, y, z for the patient' and I will tell them I have no doubt they did that, but they didn't write it down. What you document is critical to the clinical story you are telling," Stilley says.
Being descriptive is no crime when it comes to patient records, Stilley says. "Detail—using adjectives, descriptors—is invaluable to the record, including giving a description of a patient's presenting problems and then examining the patient and describing your findings and your plan of care," she says. "Payers want you to support what you do with documentation." Because physicians need to see more patients to make up for lower reimbursement levels, it is critical they develop efficient documentation methods.
Stilley recommends physician practices perform annual audits. If issues are identified, more frequent audits could be warranted, depending on the compliance level. Training or shadowing sessions for the provider can also be helpful to more accurately capture the clinical story.
Federal auditors are on the lookout for outliers—physician practices that are consistently billing at higher or lower levels than their peers—or those for whom they receive patient complaints.
"I sometimes find physicians bill at lower levels to stay under the radar," Stilley says. "This also sends a message to peers by resulting in a loss of revenue. Overbilling is more frequent, possibly because they were taught incorrectly regarding documentation or they might have an EHR that creates a higher level of service than what is actually performed. But I believe that most are trying to document correctly."
There are instances, however, where, because of specialty (ie, cardiology, rheumatology), physicians simply have sicker patients, resulting in higher levels of service.
No matter the circumstances, Stilley says good documentation is always the best defense. If medical records are accurate, physicians can feel confident they have the necessary "evidence" to support the services they are providing and being compensated for.
Because establishing an auditing program can be overwhelming, Johnson recommends approaching it incrementally by focusing on high-dollar areas or areas where the practice might be most vulnerable due to case mix or the complexity of patients' care. Many organizations have success with auditing programs by recognizing their problem areas and targeting them for improvement.
Johnson believes EHRs, which impact workflow and how information is shared, are changing the machinations of documentation, but the objective remains the same: to clearly reflect a patient's history and the level of service provided.
"There have been a lot of changes in guidelines recently and as the changes occur, facilities must make sure all the systems that various departments are using enable data to flow across the system," she says. "If there is just one area causing the data not to flow, it is important to find that and fix it. Sometimes you might catch an interface problem because of an increased incidence of denials for a particular type of claim. It's always better, though, to catch them before they are denied."
— Annie Macios is a freelance writer based in Calgary, Alberta, Canada.

redpajama_set_name: RedPajamaCommonCrawl


text:
Bårby borg är en fornborg på södra Öland.

Bårby borg ligger strax söder om Bårby by i Mörbylånga socken. Det är den enda av öns fornborgar som utnyttjar en naturlig bergbrant. Borgen består av en halvcirkelformad stenvall som går fram till landborgskanten. Borgens diameter är 150 meter.

Borgens inre område har varit uppodlat. Fynd visar att borgen har bebyggts under två perioder, dels under folkvandringstiden och senare under medeltiden, liksom två av Ölands andra fornborgar, Eketorp och Gråborg.

Borgens syfte var bland annat Ölands försvar mot pirater från Baltikum. Den var i bruk fram till 1600-talet.

Vid utgrävningar hittades föremål som dräktspännen, knivar, kammar och lerkärl. Betydande är fyndet av ett guldmynt som präglades åt den bysantiska kejsaren Justinus I som regerade mellan 518 och 527.

Referenser

Fornborgar på Öland
Byggnader i Mörbylånga kommun

redpajama_set_name: RedPajamaWikipedia


Take a peek on the different mobile dishwashing trailers we have. See how each trailer looks like in the outside, as well as the inside. We also have included photos of our past customers both for mobile dishwashing trailers and temporary kitchen units.


Anthony Whatmore & Company is a well-established, client centred law firm offering a personal approach to legal services. Founded by Anthony Whatmore, a specialist conveyancer and property lawyer with over 30 years legal experience, the firm prides itself on a client focused approach where every client is treated as the only client.
The company opened for business in 1997 with just two people and has under the guidance of its founder grown steadily over the last 18 years, necessitating relocation to more spacious offices at the company's current location on Adelaide Tambo Drive. This move allowed the firm to provide a more convenient service to clients in the Durban North and surrounding Communities where Anthony is well known, having lived in the area for many years.
When he established the practice Anthony recognised that clients were often cornered into choosing between the personal attention, but lack of diversity of a smaller practice, or the wider scope but more impersonal approach of a larger firm of lawyers. Today Anthony Whatmore & Company offers the best of both worlds….
The company's client focused service ethos and in-house capabilities has been combined with a handpicked network of consummate professionals to offer the full range of legal services expertise in all aspects of business and commercial law, property, trusts and estates, family law and litigation. In fact with very few exceptions, the company is able to offer clients the full ambit of professional legal services.
When can creditors attack trust assets?
Copyright © 2019 Anthony Whatmore & Company. Powered by WordPress. Theme: Spacious by ThemeGrill.


text:
Q: How to create provisioning profile to develop on personal device using free developer account? When I plug my iPhone in and try to run using Xcode 8.1 and deploying to iOS 10.1 I get a couple errors:
Unable to add device 'My iPhone' because the team has already reached the maximum number of iPhone devices.
No profiles for <my bundle ID> were found:  Xcode couldn't find a provisioning profile matching <my bundle ID>.
Code signing is required for product type 'Application' in SDK 'iOS 10.1'
I'm not sure why I'm getting the team has already reached the maximum number of iPhone devices error. To my knowledge I only have one and it's the one I'm trying to use now. In my https://appleid.apple.com/account/manage this is what it shows:  Is this the right place for maintaining the iPhone devices on my team and if not where do I do that?
I think the main issue is that I don't have a provisioning profile and am not quite sure how to make one.
I go to my account in the preferences and I already have a signing identity  but don't know how to create a provisioning profile.
How can I create a new provisioning profile to continue developing on my personal device? Thanks!

A: So I ended up calling Apple Developer Support and they say because the apple ID I'm trying to use was previously (many years ago) attached to a paid account and that this free developer account is new, there isn't a way to use this apple ID with the free developer account. They recommend I create a new apple ID (which I know isn't optimal) but it works now.

redpajama_set_name: RedPajamaStackExchange


So many things in this world are just too expensive: the power bill, health insurance, Cinnamon Jungle Munch cereal and mixed nuts. It's just insane! Fortunately, you can still borrow a book from the public library free of charge. Even better – after you have a library card (available at your local library), you can actually go online, browse for books and borrow them for a week at a time on your Amazon Kindle or on a PC running the Kindle for PC software. Libraries here in South Georgia allow you to borrow 5 books (including audio books) at a time each for a period of one week with renewals allowed as long as someone else hasn't placed a hold on that particular book. At least in Georgia, there isn't a central location for all of your browsing, downloading, renewing and returning of ebooks, so be sure to bookmark this page since it has some links below that will help co-ordinate your book borrowing experience.
manage Your Content and Devices – return kindle books or deliver your book to a particular kindle or Kindle for PC.
And there you go – read great books free of charge without even leaving the house.


text:
Thubten Ngödrub (Pagri (Yatung), 13 juli 1957) is sinds 1987 het veertiende Tibetaans staatsorakel en viceminister van de Tibetaanse regering in ballingschap.

Levensloop
Ngodrub vluchtte met zijn ouders op tweejarige leeftijd na de opstand in Tibet van 1959 uit Pagri naar India. Zijn ouders waren werkzaam in de wegenbouw. In 1969 kwam hij naar Dharamsala, naar de Indiase vestiging van het Tibetaanse klooster Nechung en in 1971 werd hij monnik.

Al op jonge leeftijd viel hij in trance. Na de dood van het dertiende orakel, Lobsang Jigme, in 1984 werd Ngodrub op 4 september 1987 tot veertiende staatsorakel benoemd. Hij woont tegenover het klooster Nechung in Dharamsala.

Françoise Bottereau (co-)regisseerde twee documentaires over Ngodrub en was coauteur van de autobiografie van Ngodrub.

Autobiografie
 Nechung, l'oracle du dalaï-lama, autobiografie met Françoise Bottereau-Gardey en Laurent Deshayes, Presses de la Renaissance, Parijs 2009, ISBN 978-2-7509-0487-6

Tibetaans geestelijke
Tibetaans politicus


Two years after the release of the Absolute 3 Collection, we're now showcasing Absolute 4 at this year's NAMM show.
The Absolute 4 Collection offers over 100 GB of synthesizers and workstations including Groove Agent 5, HALion 6, HALion Sonic 3, The Grand 3, Padshop Pro, and Retrologue 2.
Also included are expansion sets such as Prime Cuts and Rock Essentials for Groove Agent, Granular Guitars for Padshop Pro, Dark Planet, Hypnotic Dance, Triebwerk, and more. And the entire collection is compatible with VST, AU, and AAX, so you can run it with any DAW you like!


Scott Alario's photographs depart from a collaborative process in which he, his wife, and their children work together to stage and perform each scene. Alario's experimental approach to portraiture includes the use of multiple exposure, color separation, and macro lenses, to document the movement and actions of the young members of his family: "I'm looking for: unseeable squirming, shifting, and growth, arms flailing in ecstasy, or light slowly moving across our walls." Alario received a MFA in Photography from the Rhode Island School of Design in 2013 and a BFA from the Massachusetts College of Art in 2006. His work has been discussed in The New Yorker, American Photo, Collector Daily, Time Lightbox, and Vice.com, among other publications.


The All Progressive Congress, Delta State Leader, Olorogun O'tega Emerhor OON, and His lovely Wife Rita Emerhor will be giving out their Daughter, Onajiter Tracy Emerhor into Marriage to Mr Anthony Ogwe who is from Imo State.
The traditional marriage that is schedule to take place in Ewwreni, Ughelli North local government Area of Delta State, the country home of the bride parents will kick off 17 April 2017. Meanwhile Saturday, 29 April 2017 by 2:pm the white wedding will take place at Ikoyi Baptist Church, 5/7 Lateef jakande avenue (former Bell Avenue, Lekki, Lagos.
We say congratulation to them in advance!


The future of our world heavily depends on relations between the US, a new country and the incumbent superpower, and China, an ancient empire and a rising superpower. Making these relations particularly challenging have been the election of Donald Trump, a populist xenophobe, in the US, and the ascendancy of Xi Jinping, a centralising autocrat, in China.
No less contrasting, however, are the perspectives of these two on the world economy.
Forty years ago Mao Zedong ruled China: his aim was autarky. Ever since 1978, however, the watchword of China's economic policy has been the "reform and opening up" proposed by his successor Deng Xiaoping.
Meanwhile, the US, progenitor of post-second World War liberal internationalism, is consumed with self-doubt, and so has elected as leader a man who considers this outstandingly successful policy inimical to his country's interests.
One of today's ironies is this reversal of attitudes towards the open world economy. Nothing better illustrates this than the contrast between the strong support for globalisation offered by President Xi at the World Economic Forum annual meeting in Davos in January and Trump's egregious assertion, just three days later, that "protection will lead to great prosperity and strength".
The communiqué of the meeting of the Group of 20 finance ministers in Germany last weekend duly dropped last year's language vowing to "resist all forms of protectionism".
Participation in this year's China Development Forum has brought home to me some of the deeper roots of today's disenchantment. Chinese participants told me privately that they had once looked to the US as the successful model of capitalism, democracy and economic opening. The global financial crisis, election of Trump and US protectionism have devastated its prestige in all three respects.
Westerners complain, in turn, that the rhetoric of Chinese openness is far from matched by reality, pointing not least to the promotion of national champions, especially in advanced industries. Another objection is to commercial cyber-espionage. In addition to this is disappointment that support for China's economic opening has not yet led to greater democracy.
Yet it is also evident that this odd couple is doomed to co-operate if essential global public goods – management of the global commons, international security and stable prosperity – are to be secured.
Trump may declare "America first". The Chinese leadership may focus on the welfare of its own citizens. But neither will be able to deliver what they want without paying attention to the interests and views of others. It is astonishing that today the Chinese leadership seems to understand this better than that of the US.
Trump has targeted China's trade and foreign exchange policies. He has even flirted with challenging the "one China" policy under which the People's Republic is the only legitimate Chinese state. To this must be added the gulfs in personality and experience between the "tweeter-in-chief" and the communist apparatchik, the dealmaking real estate developer and the triumphant climber of the party's greasy pole.
Second, Xi needs to bring home to Trump that his views on China's policies are hopelessly out of date. China has spent $1 trillion of its currency reserves on keeping the renminbi up since June 2014. Between 2006 and 2016, China's exports fell from 35 per cent to 19 per cent of gross domestic product. The all-conquering export machine is an old story.
China needs to recognise that, in an interdependent world, others have a reasonable interest in what it does. This applies also to the size of its current account surpluses. Of course, Trump has to understand similar points. If he does not care about the global consequences of what he does, why should China?
Fourth, China can help give Trump what he wants. The US president wants greenfield industrial investments in parts of his country damaged by deindustrialisation. This can never be reversed. But Xi can surely find Chinese businesses happy to invest in the US. Trump likes such announcements. Xi should help him.
Finally, Trump wants an infrastructure boom in the US. China, in its turn, is by far the world's greatest exponent of fast infrastructure delivery. It must be possible to marry China's capabilities to Trump's objectives.


text:
You are here - Welcome to LSE > Calendar > Undergraduate > Course guides > LL284 Topics in Sentencing and Criminal Justice
LL284 Half Unit
Topics in Sentencing and Criminal Justice
Dr Richard Martin
This course is available on the BA in Anthropology and Law and LLB in Laws. This course is available with permission as an outside option to students on other programmes where regulations permit. This course is available to General Course students.
In this course we explore the routine practices and decision-making of key actors within the criminal justice system. In doing so, we examine the laws, policies and regulatory schemes that purport to govern how actors perform their specific roles in the criminal process. In the first five weeks, we track the construction of cases through the criminal process. This requires us to closely analyse the work of police, prosecutors and judges: How do they exercise their discretion? What kinds of dynamics, sub-cultures and formal (and informal) rules affect their decision-making? And how does this impact on the rights and interests of suspects, defendants, offenders and victims? In the second five weeks, we enter the realm of sentencing law and practice. We focus on how judges perform their role as sentencers, the principles and legal guidelines they rely upon and the types of sentences they can (or must) hand down in different types of cases. We use the sentencing of rioters and community sentences as case studies to apply the general principles of sentencing, then conclude the course by assessing the impact that Covid-19 has had on the criminal justice system. By preparing fully for seminars and actively contributing to our discussions, the course will equip you with the knowledge and tools necessary to critically assess contemporary criminal justice issues.
1. The Criminal Justice System in England and Wales
2. In the Community: What Do Police Do and Why Do They Do It?
3. In the Station: Police Practices and Case Construction
4. Bringing the Case: Prosecutorial Discretion and Victims' Rights
5. In Court: The Criminal Courts and Legal Representation
6. Reading Week
7. Sentencing Rationales: Aims, Principles and Policies
8. Sentencing Practices: Discretion and Guidelines
9. Sentencing in Turbulent Times: Rioters
10. Community Sentences
11. The Impact of Covid-19 on the Criminal Justice System
This course will have a minimum of two hours of teaching content each week, either in the form of a two hour seminar or an online lecture and one hour class. This course includes a reading week in Weeks 6 of term.
Seminars include small group discussion and full class discussions, as well as practical exercises in which you are tasked with advising fictional clients or performing the role of sentencing judges. I will begin the seminar with some introductory remarks, usually outlining the topic or setting out its legal or political context. There are PowerPoint slides which will be uploaded on the Course's Moodle webpage in advance of each seminar. We will work in and out of these slides during the seminar.
Students will be expected to produce a 1500-word literature review.
I want to encourage you to take responsibility for what you read and to come to class keen to present your own thoughts and ideas based on this reading. There is textbook reading, but I am keen to keep the material and topics we discuss as relevant as possible, so I have updated these texts with more recent articles or chapters I think are particularly helpful or insightful. Sanders, Young and Burton's Criminal Justice is a brilliant text, albeit badly out of date (the latest edition was 2010). The standard sentencing text for England and Wales is: A. Ashworth (2015) Sentencing and Criminal Justice (6th ed., Cambridge: CUP) and S. Easton and C. Piper (2016) Sentencing and Punishment: The Quest for Justice (4th ed., Oxford: OUP) is also good. Most of our readings are articles in journal e.g. British Journal of Criminology (BJ Crim), the Criminal Law Review (Crim LR) and the Journal of Law and Society (J. Law & Soc) and chapters in edited collection (various readings come from the sixth edition of The Oxford Handbook of Criminology, as well as Changing Contours of Criminal Justice).
Essay (100%), 5000 words.


We're here to help 24 hours a day, 7 days a week.
Chat directly with our team and get help with your questions.
Select a suitable time and day for us to call you over the phone.
Email us at [email protected] or leave us a message on the form below.