Just Other Articles
#1 in Business Subscribe Email Print

You are here: Home > Internet and Businesses Online > Web Development > Building An Application Framwork In Mod_Perl Using Cpan Modules - Part 2

Tags

  • handle
  • advantages
  • these
  • combination products
  • companies involved

  • Links

  • What Happens To Suicide Cases After Death
  • Positive Attitude - Can It Make or Break Your Success
  • Cashing In by Writing How-to's
  • Just Other Articles - Building An Application Framwork In Mod_Perl Using Cpan Modules - Part 2

    Introduction

    In the previous article I discussed the basics of rolling your very own application framework covering the structure, setup and layout of such a system and also covered templating. In this article we will add juicy features such as database h
    According to USFDA, a combination product is one composed of any combination of a drug and device; biological product and device; drug and biological product
    andling, interacting with remote web sites via SOAP and email functionality. Database handling The secret to handling databases in a web environment is to ensure strict clean code, e.g. ensuring database and statement handles and data structures are opened and cl
    ; or drug, device, and biological product and fixed dose combination would include two or more combinations of drug.

    Examples of combination products may in
    osed properly. It is very common for database and statement handles to left open by developers when using the age old copy and paste technique of building their application. How often have you written a script and forgot to call close() on a method? Of course per
    lude drug-coated devices, drugs packaged with delivery devices in medical kits, and drugs and devices packaged separately but intended to be used together.

    sistence is important when dealing with databases for the web, thankfully mod_perl allows for this quite nicely by extending the standard DBI class with Apache::DBI. You may have noted in Part 1 that a global var was declared to hold the database handle, this sol
    here is enormous increase in the number of combination products entering the market in the recent years. Combination products have proven advantages but fixe
    ves the persistence issue. Here we will describe a system that deals with a single database and/or other/multiple databases. In our Base.pm class the constructor opens a connection to the database, here it is: sub new {

    my $self = [];

    bless($self);

    my $db_na
    d dose combinations are still in the process of convincing regulatory authority on their advantages over the single ingredient formulations.

    Combination pro
    me = Website::Constants::DB_NAME;

    my $db_user = Website::Constants::DB_USER;

    my $db_pass = Website::Constants::DB_PASS;

    $dbh = DBI->connect('DBI:mysql:'. $db_name, $db_user, $db_pass);

    $self->[DB_ERROR] = '';

    unless ( defined($dbh) && $dbh ) {

    $self->debug(
    ucts have become life saving products for the pharmaceutical companies who doesn’t have many innovative molecules in their product pipeline and have been inc
    1, 'Unable to connect to MASTER DB!' );

    $self->[DB_ERROR] = 'Unable to connect to DB!';

    }

    return $self; }

    This provides basic error checking and logging of the attempt to connect to the database. Taking this to next step, in this class we will define the fu
    easingly used in the product life cycle management. Even the companies having product patents are trying to extend their product life cycle through the combi
    nctions used to interact with the database, i.e. selects, updates and inserts. Here follows our db_select function for retrieving rows from the database in a nice clean fashion: sub db_select {

    my $self = shift;

    my $query_handle = shift;

    my $args = shift;

    m
    nation products and maximize the revenues. But the companies involved in this practice are overlooking that they are burdening the patients both economically
    y $sql = $self->get_query( $query_handle );

    unless ( $sql ) {

    $self->[DB_ERROR] = "No such database query: $query_handle";

    return -1;

    }

    my $has_args = @{$args};

    my $db = undef;

    $db = pop(@{$args}) if ( $has_args > 0);

    my $valid_db = 0;

    if ( $db =~ /SELEC
    and physically. They need to rightly judge the benefits of the combination products and they have to even look at the risks involved when combining the produ
    T/ ) {

    $db =~ s/SELECT//;

    $valid_db = 1;

    }

    push(@{$args}, $db) unless ( $has_args == 0 || $valid_db == 1 );

    my $this_dbh = undef;

    my $sth = undef;

    if ( $db && $valid_db ) {

    $this_dbh = DBI->connect('DBI:mysql:tracker_' . $db, 'root', '5exy');

    unless ( de
    ts. Some of the combination products were well accepted by physicians while others suffered. Companies involved in development of combination products are fi
    ined($this_dbh) && $this_dbh ) {

    $self->debug( 1, 'Unable to connect to CUSTOM DB: ' . $db );

    }

    $sth = $this_dbh->prepare($sql);

    }

    else {

    $sth = $dbh->prepare($sql);

    }

    if ( $args && $has_args > 0 ) {

    if ( @{$args} > 0 ) {

    unless ( $sth->execute( @{$args
    ding difficulty in defining their combination products and facing various challenges from selecting a combination to marketing it.

    Following aspects would a
    } ) ) {

    $self->debug( 1, $query_handle . ": " . $dbh->errstr);

    $self->[DB_ERROR] = $dbh->errstr;

    return -1;

    }

    }

    }

    else {

    unless ( $sth->execute() ) {

    $self->debug( 1, $query_handle . ": " . $dbh->errstr);

    $self->[DB_ERROR] = $dbh->errstr;

    return -1;

    }
    dd to the challenges in developing combination products:

    Which markets to tap where the combination products can do fairly well?
    Which combination prod


    }

    $rows = $sth->fetchall_arrayref();

    $sth->finish();

    $self->debug(1, "Database: $query_handle failed" ) unless ( $rows );

    return $rows; }

    Ok, so at first glance it may look complex but I'll simplify. Firstly, the function expects the first argument to be
    cts are meaningful and rational?
    Which therapeutic categories to select?
    Which Combinations can address unmet needs of the patients?
    Do combin
    a database statement, which is read from a file (in this case a simple text file in the format 'statement = select * from mytable where col1 = ? and col2 = ?'), followed by an optional database name preceded with the word SELECT (e.g. SELECTmydb where mydb is the
    tions increase the patient compliance?
    What would be the developing cost?
    How to tackle the risks encountered during combination product developmen
    database to use), and then a list of parameters to fill in the statement, i.e. the value for col1 and col2. This function checks for existence of database to use (checking an argument with prefix SELECT) and also the existence of any parameters to pass to statem
    t?

    As combination products don't fit into the traditional categories of drugs, medical devices, or biological products, the USFDA is in the process of devel
    ent. Depending on whether or not any of these are present the correct action is taken to read from the database, in the case that there are no parameters to be passed to the statement, DBI execute is called as such, in the case a custom database is supplied this
    ping new procedures for reviewing their safety, efficacy and quality.

    Professional from academic institutions, pharmaceutical industries, health care indust
    database is used to supply results. Once the database and statement parameters have been taken care off the resulting dataset is slurped into an array ref to be returned after closing the statement handle. Note that the database handle is left open, this is inten
    y and representatives from various regulatory agencies are working out to design the regulatory requirements for manufacture and sale of combination products
    tional to provide a persistent connection. There is also some logging done in the event of an error or no data being returned, this could be modified to explicitly state which is the case. This function is modified quite easily to provide seperate functions to ha
    .

    As there is an increasing trend of the combination products companies manufacturing such products should be able to tackle the problems involved in the de
    ndle SQL update/deletes and inserts, the same principles apply just needing modification for specifics of a db_update function for update/deletes and a db_insert function, the above example should be enough to get you started on these. To call this in your applic
    elopment. They need to be wiser in analyzing the market trends and the regulatory requirements.

    Companies that provide selfless information through particip
    ation using orders_db, then with standard db as loaded on startup: my $rows = $self->db_select('get_orders', ['SELECTorders_db', $order_id]);

    for $order (@{$rows}) {

    print "Product ID: $order->[0]n"; }

    my $rows2 = $self->db_select('get_orders', [$order_id])


    tion in industry events and feedback to regulatory authorities would be able to face the challenges and will be successful in developing combination products

    HTTP = HTML link (for blogs, profiles,phorums):
    <a href="http://www.justotherarticles.org.ua/article/86482/justotherarticles-Building-An-Application-Framwork-In-ModPerl-Using-Cpan-Modules--Part-2.html">Building An Application Framwork In Mod_Perl Using Cpan Modules - Part 2</a>

    BB link (for phorums):
    [url=http://www.justotherarticles.org.ua/article/86482/justotherarticles-Building-An-Application-Framwork-In-ModPerl-Using-Cpan-Modules--Part-2.html]Building An Application Framwork In Mod_Perl Using Cpan Modules - Part 2[/url]

    Related Articles:

    Banner Stand Exhibits

    The Importance of Business Marketing

    Top 7 Tips to Starting Your Own Business

    Bookmark it: del.icio.us digg.com reddit.com netvouz.com google.com yahoo.com technorati.com furl.net bloglines.com socialdust.com ma.gnolia.com newsvine.com slashdot.org simpy.com shadows.com blinklist.com