Package notify

initialize notify module

Sub-modules

notify.notifications

Defines the UserNotification class used by Notifier to build messages

notify.notifier

features associated with end user notifications for reconciliation and other edge case handling

Classes

class ErrorNotification (facility: str, function_name: str, error_type: str = 'Unknown', error_message: str = 'Unknown', traceback: str = 'Unknown', concerned_roles: Sequence[SubscriptionType] = ('Developer',))

A collection of fields describing an error notification.

Class variables

var concerned_roles : Sequence[SubscriptionType]
var error_message : str
var error_type : str
var facility : str
var function_name : str
var traceback : str

Static methods

def from_exc_info(facility: str, function_name: str, exc_info: None | ErrInfo = None, mock: bool = False) ‑> ErrorNotification

returns a new UserNotification instance using the data from the job(s)

class EventType (value, names=None, *, module=None, qualname=None, type=None, start=1)

Convenient access to predefined notification event descriptions

Ancestors

  • builtins.str
  • enum.Enum

Class variables

var CASE_ADDED
var CASE_CLONED
var CASE_CLOSED_BATCH_CLOSED
var CASE_CLOSED_BATCH_OPEN
var CASE_DOCS_UPDATED
var DUPLICATE_BATCH_CREATED
class NotificationProto (*args, **kwargs)

data elements required for describing a single user notification

Ancestors

  • typing.Protocol
  • typing.Generic

Class variables

var concerned_roles : Sequence[SubscriptionType]
var facility : str
var mock : bool
class Notifier (client_name: str, notifications: Sequence[NotificationProto], output_dir: str | None = None, subject: str = 'Claim Maker Notifications - 20240828', body_text: str = 'Please review the attached notifications from Hank AI Claim Maker.', body_html: str = '<html>\n <head></head>\n <body>\n <a href="https://hank.ai"><img width="198" height="62"\n src="https://hank.ai/wp-content/uploads/2022/08/hank-logo-black-htm-white-bg-660px.png" />\n </a><br>\n <h3>{}</h3>\n <p><a href="https://claimmaker.hank.ai/app/coder">Open Claim Maker</a> (requires VPN)</p>\n </body>\n </html>\n ', encoding: str = 'utf-8')

send a table of edge case handling notifications to client emails

Class variables

var body_html : str
var body_text : str
var client_name : str
var encoding : str
var notifications : Sequence[NotificationProto]
var output_dir : str | None
var subject : str

Methods

def create_attachment(self) ‑> email.mime.application.MIMEApplication

build an attachment from the provided notifications using pandas

def create_message(self) ‑> email.mime.multipart.MIMEMultipart

build the email as a MIME multipart message

def log_summary(self)
def send(self)

construct and send a raw email for the supplied notifications

class SubscriptionType (value, names=None, *, module=None, qualname=None, type=None, start=1)

Convenient access to valid roles

Ancestors

  • builtins.str
  • enum.Enum

Class variables

var ACCT_MGR
var ADMIN
var AUDITOR
var CHG_ENTRY
var CODER
var CODER_ADMIN
var DATA_ENTRY
var DEV
var RC_ADMIN
var RECONCILER
class UserNotification (facility: str, concerned_roles: Sequence[SubscriptionType], date_of_service: str, event_description: str | EventType, batch_id: int, batch_state: str, case_id: int, case_state: str, case_state_reason: str, created_batch_id: int = -9999, created_case_id: int = -9999)

A collection of fields describing a user event notification.

Use the from_job class method to create a notification from directly from job(s) as returned by dbops.job_library / as constructed from PDFs in the final TableTransformer output.

Class variables

var batch_id : int
var batch_state : str
var case_id : int
var case_state : str
var case_state_reason : str
var concerned_roles : Sequence[SubscriptionType]
var created_batch_id : int
var created_case_id : int
var date_of_service : str
var event_description : str | EventType
var facility : str

Static methods

def from_job(roles: Sequence[SubscriptionType], event_type: str | EventType, job: dict[str, Any], to_case_state: str = '', to_case_state_reason: str = '', created_batch_id: int = -9999, mock: bool = False) ‑> UserNotification

returns a new UserNotification instance using the data from the job(s)