Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: IBCORC3

IBCORC3.m

Go to the documentation of this file.
  1. IBCORC3 ;ALB/CPM - RANK INSURANCE CARRIERS (NEW BULLETIN) ; 02-DEC-94
  1. ;;2.0;INTEGRATED BILLING;**29,47,64,116**;21-MAR-94
  1. ;
  1. BULL ; Generate a specially formatted bulletin for the MCCR Program Office.
  1. ;
  1. ; - first, invert the list by carrier to rank by number of claims
  1. S (IBNR,IBINS)=0 F S IBINS=$O(^TMP("IBORIC",$J,"IC1",IBINS)) Q:'IBINS S ^TMP("IBORIC",$J,"NUM",-$G(^(IBINS)),IBINS)="",IBNR=IBNR+1
  1. ;
  1. S IBSITE=$P($$SITE^VASITE,"^",3),IBDAT=$$DAT1^IBOUTL(DT)
  1. S XMSUB="PRQC IBINS: "_IBSITE_" Top "_IBNR_" Billed "_IBDAT
  1. S XMDUZ="INTEGRATED BILLING PACKAGE"
  1. K ^TMP($J,"IBORIC") S XMTEXT="^TMP($J,""IBORIC"","
  1. S XMY(DUZ)=""
  1. I $$PROD^IBCORC() S XMY(IBMAILTO)=""
  1. ;
  1. ; - set up report body
  1. S IBCNT=0,IBNUM=""
  1. F S IBNUM=$O(^TMP("IBORIC",$J,"NUM",IBNUM)) Q:IBNUM="" D
  1. .S IBINS=0 F S IBINS=$O(^TMP("IBORIC",$J,"NUM",IBNUM,IBINS)) Q:'IBINS D
  1. ..S IBCNT=IBCNT+1,IBAMT=+$G(^TMP("IBORIC",$J,"IC",IBINS))
  1. ..S ^TMP($J,"IBORIC",IBCNT)=IBSITE_"^"_IBCNT_"^"_$$INS(IBINS)_"^"_$J(IBAMT,"",2)_"^"_-IBNUM_"^"_IBINS
  1. ;
  1. ; - deliver and quit
  1. D ^XMD
  1. K ^TMP($J,"IBORIC"),IBNUM
  1. K IBAMT,IBCNT,IBC,IBDAT,IBINS,IBSITE,IBT,X,XMSUB,XMDUZ,XMY,XMTEXT,Y
  1. Q
  1. ;
  1. INS(IBCNS) ; Format Insurance Company name and address for bulletin.
  1. ; Input: IBCNS -- pointer to the insurance company in file #36
  1. N IBCNS0,X,Y
  1. S IBINS0=$G(^DIC(36,IBCNS,0))
  1. S Y=$S($P(IBINS0,"^")]"":$P(IBINS0,"^"),1:"CARRIER UNKNOWN") ; name
  1. S Y=Y_"^"_$S($P(IBINS0,"^",5):0,1:1) ; 1-active, 0-inactive
  1. S X=$G(^DIC(36,IBCNS,.11))
  1. S Y=Y_"^"_$P(X,"^") ; address [line 1]
  1. S Y=Y_"^"_$P(X,"^",2) ; address [line 2]
  1. S Y=Y_"^"_$P(X,"^",4) ; city
  1. S Y=Y_"^"_$P($G(^DIC(5,+$P(X,"^",5),0)),"^",2) ; state
  1. S Y=Y_"^"_$P(X,"^",6) ; zip code
  1. S X=$G(^DIC(36,IBCNS,.13))
  1. S Y=Y_"^"_$P(X,"^") ; phone number
  1. S Y=Y_"^"_$P(X,"^",2) ; billing phone number
  1. Q Y
  1. ;
  1. ;
  1. IRM ; IRM Entry Point to queue a one-time (?) job for MCCR.
  1. ;
  1. I $S('($D(DUZ)#2):1,'$D(^VA(200,+DUZ,0)):1,'$D(DUZ(0)):1,1:0) D G IRMQ
  1. .W !!?3,"The variable DUZ must be set to an active user code and the variable"
  1. .W !?3,"DUZ(0) must also be defined to run this routine."
  1. ;
  1. ; - set parameters, if not defined, as needed for the compilation
  1. I '$D(IBABEG) S IBABEG=2971001
  1. I '$D(IBAEND) S IBAEND=2981231
  1. I '$D(IBNR) S IBNR=30
  1. I '$D(IBMAILTO) S IBMAILTO="S.PRQC SERVER IBINS@ISC-ALBANY.DOMAIN.EXT"
  1. S IBIRM=1
  1. ;
  1. W !!,"This job will compile a ranking of all your insurance carriers by the total"
  1. W !,"number of claims billed from ",$$DAT1^IBOUTL(IBABEG)," to ",$$DAT1^IBOUTL(IBAEND),". The compilation will be"
  1. W !,"uploaded into a mail message and sent to the MCCR National Database where"
  1. W !,"it will be re-formatted in a PC-downloadable format and sent to the"
  1. W !,"MCCR Program Office. This mail message will also be sent to you."
  1. ;
  1. ; - warn that the software is not being executed in Production
  1. I '$$PROD^IBCORC() D
  1. .W !!,*7," *** Please note ***"
  1. .W !!?3,"You appear to be executing this routine in a test account."
  1. .W !?3,"The mail message will only be sent to you."
  1. ;
  1. ; - okay to continue?
  1. S DIR(0)="Y",DIR("A")="Do you want to queue this job now"
  1. W ! D ^DIR K DIR I 'Y G IRMQ
  1. ;
  1. ; - queue the job up to be run
  1. W !!,"Please enter the date and time to execute this job...",!
  1. S ZTRTN="DQ^IBCORC1",ZTIO="",ZTDESC="IB - RANKING CARRIERS (FROM IRM)"
  1. F I="IBABEG","IBAEND","IBNR","IBIRM","IBMAILTO" S ZTSAVE(I)=""
  1. D ^%ZTLOAD W !!,$S($D(ZTSK):"This job has been queued. The task number is "_ZTSK_".",1:"")
  1. ;
  1. IRMQ K IBABEG,IBAEND,IBMAILTO,IBNR,IBIRM,X,Y,DIRUT,DUOUT,DTOUR,DIROUT,I,ZTSK
  1. Q