#include ../../header.iphtml #include ../../checkuser.iphtml

param('wid'); if ($main::cgi->param('id')) { &display_vop($wkshp_no); } elsif ($main::cgi->param('button')) { &submit_credits($wkshp_no); } else { &list_vop(); } sub list_vop { my ($total_cme) = 0; my ($max_cme) = 0; my $voplist = ''; my $vopSQL = ''; return; $sth = $main::dbh->prepare ("SELECT non_pharm,pharm FROM new_lecture,meeting_evaluated WHERE meeting_evaluated.sessionID=new_lecture.lectureid AND meeting_evaluated.memberID=$userID AND meeting_evaluated.meetingID=$meeting_no"); $sth->execute() || die "Couldn't execut query: $DBI::errstr\n"; undef(@ary); $total_cme = 0; while (@ary = $sth->fetchrow_array()) { if ($ary[1]) { $total_cme += $ary[1]; } else { $total_cme += $ary[0]; } } $sth->finish; if (!$total_cme) { print p("$participant : You have not accumulated any CME credit hours for this course. Click ",a({href=>'topics.iphtml'},'here')," to complete the evaluation form. After completing the evaluation form, return here to certify and submit your CME hours."); } else { # my $fullcourse = 0; # $cursor = $main::dbh->prepare (qq{ # SELECT IF(workshop_no>0,'0','1') FROM registrants WHERE meeting_no=? AND member_id=? ORDER BY workshop_no DESC LIMIT 1 # }); # $cursor->execute($meeting_no, $userID); # $fullcourse = $cursor->fetchrow(); # $cursor->finish(); if ($fullcourse) { $vopSQL = "SELECT t1.meeting_no, t1.workshop_no, t1.breakout_no, t2.name FROM registrants t1, meeting t2 WHERE t1.meeting_no = t2.meeting_no AND t1.workshop_no = t2.workshop_no AND t1.breakout_no = t2.breakout_no AND t1.cme='N' AND t1.workshop_no=0 AND t1.member_id = $userID AND t1.meeting_no = $meeting_no ORDER BY t2.workshop_no"; } else { $vopSQL = "SELECT registrants.meeting_no, registrants.workshop_no, registrants.breakout_no, meeting.name FROM registrants, meeting WHERE registrants.meeting_no = meeting.meeting_no AND registrants.workshop_no = meeting.workshop_no AND registrants.breakout_no = meeting.Breakout_no AND registrants.attended='Y' AND registrants.cme='N' AND member_id = $userID AND registrants.meeting_no = $meeting_no ORDER BY meeting.workshop_no"; } # $vopSQL = "SELECT registrants.meeting_no, registrants.workshop_no, registrants.breakout_no, meeting.name FROM registrants, meeting WHERE registrants.meeting_no = meeting.meeting_no AND registrants.workshop_no = meeting.workshop_no AND registrants.breakout_no = meeting.Breakout_no AND registrants.attended='Y' AND member_id = '$userID' AND registrants.meeting_no = '$meeting_no' ORDER BY meeting.workshop_no"; # SHOW VOP IF SUBMITTED OR NOT $sth = $main::dbh->prepare ($vopSQL) || die "Prepare failed: $DBI::errstr\n"; $sth->execute() || die "Couldn't execute query: $DBI::errstr\n$vopSQL\n"; undef(@ary); @ary = $sth->fetchrow; $sth->finish; if (@ary) { print h3({-align=>'center'},'Do Not Submit Your Verification Form until after you have completed your evaluation of ALL topics you have attended.'); print p("$participant : Click on the link(s) below to complete your Verification of Participation Form."); $sth->execute; while (@ary = $sth->fetchrow()) { $voplist .= "
  • $ary[3]
  • \n"; } $sth->finish; print ""; } else { print p('Your Verification of Participation Forms for this meeting have been received. If you have prematurely submitted your form before you completed all the evaluation forms, you must contact the SPA office.'); print p(em('Society for Pediatric Anesthesia'),'
    2209 Dickens Road
    Richmond, VA 23230-2005'); print p('804-282-9780 Phone
    804-282-0090 Fax
    ',a({href=>'mailto:spa@societyhq.com'},'spa@societyhq.com'),' Email'); print p("
    "); } } } sub display_vop { my $workshopID = shift; my $complete = 1; my $vopSQL = ''; my ($total_cme) = 0; my ($total_moco) = 0; my ($total_hrs) = 0; my ($max_cme) = 0; return; my $cursor = $main::dbh->prepare(qq{ SELECT aba_id FROM member WHERE member_id = ? }); $cursor->execute($userID); undef(@fields); @fields = $cursor->fetchrow; $cursor->finish; my ($aba_num) = $fields[0]; if ($fullcourse) { $vopSQL = "SELECT non_pharm,pharm FROM new_lecture,meeting_evaluated WHERE meeting_evaluated.sessionID=new_lecture.lectureid AND meeting_evaluated.memberID=$userID AND meeting_evaluated.meetingID=$meeting_no"; } else { $vopSQL = "SELECT non_pharm,pharm FROM new_lecture,meeting_evaluated WHERE meeting_evaluated.sessionID=new_lecture.lectureid AND meeting_evaluated.memberID=$userID AND meeting_evaluated.meetingID=$meeting_no AND meeting_evaluated.workshopID=$workshopID"; } $sth = $main::dbh->prepare(qq{$vopSQL}); $sth->execute() || die "Couldn't execut query: $DBI::errstr\n"; undef(@ary); while (@ary = $sth->fetchrow_array()) { $total_moco += $ary[1]; $total_cme += $ary[0]; } $sth->finish; $total_hrs = $total_cme + $total_moco; if (!$total_hrs) { print p("You have not accumulated any CME credit hours for this course. Click ",a({href=>'topics.iphtml'},'here')," to complete the evaluation form. After completing the evaluation form, return here to certify and submit your CME hours."); $complete = 0; } if ($complete) { $vopSQL = "SELECT name,location,city,state,country,MONTHNAME(meeting.start_date), DAYOFMONTH(meeting.start_date), YEAR(meeting.end_date), MONTHNAME(meeting.end_date), DAYOFMONTH(meeting.end_date), credits FROM meeting WHERE meeting_no=$meeting_no AND workshop_no='$workshopID' AND breakout_no=0"; $sth = $main::dbh->prepare ($vopSQL) || die "Prepare failed: $DBI::errstr\n"; $sth->execute() || die "Couldn't execute query: $DBI::errstr\n$vopSQL\n"; undef(@fields); @fields = $sth->fetchrow; $sth->finish; $mtg_name = $fields[0]; $mtg_hotel = $fields[1]; $mtg_location = $fields[2] . ", " . $fields[3] . " " . $fields[4]; $mtg_date = $fields[5] . ' ' . $fields[6]; if ($fields[6] eq $fields[9]) { $mtg_date .= ", $fields[7]"; } else { if ($fields[6] ne $fields[9] && $fields[5] eq $fields[8]) { $mtg_date .= " - $fields[9], $fields[7]"; } else { $mtg_date .= " - $fields[8] $fields[9], $fields[7]"; } } $max_cme = $fields[10]; if ($fullcourse) { $vopSQL = "SELECT DATE_FORMAT(lecture_date,'%W - %M %e, %Y'), lecture,non_pharm,pharm,sessionID FROM new_lecture,meeting_evaluated WHERE meeting_evaluated.sessionID=new_lecture.lectureid AND meeting_evaluated.memberID=$userID AND meeting_evaluated.meetingID=$meeting_no ORDER BY lecture_date,lecture"; } else { $vopSQL = "SELECT DATE_FORMAT(lecture_date,'%W - %M %e, %Y'), lecture,non_pharm,pharm,sessionID FROM new_lecture,meeting_evaluated WHERE meeting_evaluated.sessionID=new_lecture.lectureid AND meeting_evaluated.memberID=$userID AND meeting_evaluated.meetingID=$meeting_no AND meeting_evaluated.workshopID=$workshopID ORDER BY lecture_date,lecture"; } $sth = $main::dbh->prepare(qq{$vopSQL}); $sth->execute() || die "Couldn't execut query: $DBI::errstr\n"; undef(@ary); print p({-style=>'color:#F00'},'Nota Bene: Please verify the number of credits you are claiming before you submit this form as you will be unable to change the number of credits once submitted.'); print p('The ',em('Society for Pediatric Anesthesia (SPA)'), 'maintains records of learner participation for six years. To enable SPA to maintain accurate records of your participation and ',strong('TO RECEIVE YOUR CME CERTIFICATE'), 'you must complete the evaluation form for each topic that you attended then submit this form.'); print "
    "; if ($total_hrs <= $max_cme) { print p({-style=>'margin-bottom:36px'},"You have accumulated a total of $total_hrs CME credit hours for the ",em("$mtg_name. ")); } else { print p({-style=>'margin-bottom:36px; color:#F00'},"You have accumulated more CME credits than the maximum ($max_cme) allowed for this course. Your credit hours will be adjusted to the maximum of $max_cme."); } print p("SPA designates this educational activity for up to ",u("$max_cme"),em("AMA PRA Category 1 Credit(s)™.")," Physicians should only claim credit commensurate with the extent of their participation in the activity."); print '
    '; print ""; print ""; print ""; print ""; print ""; # print ""; print ""; $total_cme = 0; $total_moco = 0; $total_cme = 0; COMPLETE: while (@ary = $sth->fetchrow_array()) { if ($dateholder ne $ary[0]) { # print ""; } print "\n"; print ''; print "\n"; print ""; print ""; print ""; $total_moco += $ary[3]; $total_cme += $ary[2]; #if (!$ary[2] && !$ary[3]) { # print em("No Credit Available") if (!$ary[3]); #} else { # if ($ary[3]) { # print " $ary[3]"; # } else { # print "$ary[2]"; # } #} #print "\n"; #print "\n"; $dateholder = $ary[0]; #if ($ary[3]) #{ # $total_cme += $ary[3]; #} else { # $total_cme += $ary[2]; #} } $total_hrs = $total_cme + $total_moco; print "\n"; print "\n"; # if ($total_cme <= $max_cme) { printf "\n"; # } else { # printf "\n"; # } print "\n"; print "
     CME HoursMOCA Hours
    $ary[0]
    $ary[1]$ary[2]$ary[3]
    I wish to claim the following number of credits for the above-captioned meeting:" . "%2.2f\n",$total_hrs . "" . "%2.2f\n",$max_cme . "
    \n"; print '
    '; print '

    '; print "
    \n"; print hidden(-name=>'wid',-default=>["$workshopID"]); print p(submit(-name=>'button',-value=>'Submit Credit Hours')); print p({-style=>'font-size:85%; text-align:center'},strong("From the Physician's Recognition Award Information Booklet for CME Providers:")); print p({-style=>'font-size:85%; text-align:center'},"\"Certificates for ",em("AMA PRA Category 1 Credit(s)™")," should only be given to physicians. Certificates should be provided after physicians complete the educational activity so they can document participation. Certificates should only be given for the actual credit claimed and earned by the physician.\""); print "
    \n"; $sth->finish; } } sub submit_credits { my $workshopID = shift; my ($total_cme) = 0; my ($total_moco) = 0; my ($total_hrs) = 0; my ($max_cme) = 0; my (%cookie_in) = $main::cgi->cookie("SPAID"); my ($cookie_uid) = $cookie_in{"id"}; my ($userID) = $cookie_uid; $sth = $main::dbh->prepare ("SELECT non_pharm,pharm FROM new_lecture,meeting_evaluated WHERE meeting_evaluated.sessionID=new_lecture.lectureid AND meeting_evaluated.memberID=$userID AND meeting_evaluated.meetingID=$meeting_no"); $sth->execute() || die "Couldn't execut query: $DBI::errstr\n"; undef(@ary); while (@ary = $sth->fetchrow_array()) { $total_moco += $ary[1]; $total_cme += $ary[0]; } $sth->finish; $total_hrs = $total_cme + $total_moco; my $missing = ''; if (!$main::cgi->param('signature')) { $missing .= "
  • You must check the box that you certify that you are claiming the number of hours you actually spent in the educational activity.
  • \n" }; if (!$total_hrs) { $missing .= "
  • Unable to set the number of credits hours - Please notify the SPA office of this error!
  • \n" }; if ($missing) { print p({-style=>'color:#F00'},'The following error(s) accured while submitting your credits:'); print "
      $missing
    \n"; print p('Click ',a({-href=>'vop.iphtml'},'here'), ' to go back.'); } else { my $aba_number = $main::cgi->param('ABA'); my $updateSQL = ""; if (!$aba_number) { $updateSQL = "UPDATE member SET aba_id=NULL WHERE member_id=$userID LIMIT 1"; } else { $updateSQL = "UPDATE member SET aba_id='$aba_number',updated_by='Registrant - ABA #' WHERE member_id=$userID LIMIT 1"; } $main::dbh->do(qq{ $updateSQL }); my $vopSQL = "SELECT credits FROM meeting WHERE meeting_no=$meeting_no AND workshop_no='$workshopID' AND breakout_no=0"; $sth = $main::dbh->prepare ($vopSQL) || die "Prepare failed: $DBI::errstr\n"; $sth->execute() || die "Couldn't execute query: $DBI::errstr\n$vopSQL\n"; undef(@fields); @fields = $sth->fetchrow; $sth->finish; $max_cme = $fields[0]; $total_hrs = $max_cme if $total_hrs > $max_cme; my $updateSQL = "UPDATE registrants SET credits='$total_cme', other_credits='$total_moco',cme='Y',attended='Y' WHERE meeting_no='$meeting_no' AND workshop_no='$workshopID' AND breakout_no=0 AND member_id='$userID' LIMIT 1"; my $rows = $main::dbh->do(qq{$updateSQL}); $rows += 0; if (!$rows) { print p({-style=>'color:#F00'},"We're sorry, unable to submit your Verification of Participation Form at this time. Please try again latter."); } else { print h4("Form Submitted Successfully"); print p('Your Verification of Participation Form has been received. You can now print your',a({-href=>'cme.iphtml'},'CME Certificate')); } } } !> #include ../../footer_include.iphtml