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

ACHSDHQ.m

Go to the documentation of this file.
ACHSDHQ ; IHS/ITSC/PMF - DENIAL REPORT HQ1 ; [ 10/31/2003  11:40 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**3,5,6,18**;JUNE 11,2001
 ;ACHS*3.1*3  allow denials to be reversed
 ;ACHS*3.1*5 12/06/2002  report is wrong if there are reasons with the same text
 ;ACHS*3.1*6 3/20/2003 request to list cancels and reversal in total count
 ;
 S ACHSBDT=$$DATE^ACHS("B","HQ1")
 I ACHSBDT<1 D END Q
 ;
 S ACHSEDT=$$DATE^ACHS("E","HQ1")
 ;
 ; --- Select print device
 ;S OK=0 D  I 'OK D END Q;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 S ACHSOK=0 ;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 D  I 'ACHSOK D END Q  ;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 . S %ZIS="PQ"
 . D ^%ZIS
 . I POP D HOME^%ZIS Q
 . ;I '$D(IO("Q")) S OK=1 Q;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 . I '$D(IO("Q")) S ACHSOK=1 Q  ;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 . S ZTRTN="START^ACHSDHQ",ZTIO="",ZTDESC="Print CHS DENIAL HQ1 Report",ACHSQIO=ION_";"_IOST_";"_IOM_";"_IOSL
 . F %="ACHSBDT","ACHSEDT","ACHSQIO" S ZTSAVE(%)=""
 . D ^%ZTLOAD
 . I '$D(ZTSK) Q
 . ;S OK=1 ;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 . S ACHSOK=1 ;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 . Q
 I $D(IO("Q")),$D(ZTSK) D END Q  ;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 ;
 ;
START ;EP - From TaskMan.
 N ACHSISDT,ACHSA,ACHSNR,ACHSTCN
 ;S ACHSISDT=ACHSBDT-1,ACHSTCN=0
 ;IHS/SET/JVK ADDED BELOW  3/20/2003 ACHS*3.1*6
 S ACHSISDT=ACHSBDT-1,ACHSTCN=0,ACHSYCN=0,ACHSRCN=0
 ;
 F  S ACHSISDT=$O(^ACHSDEN(DUZ(2),"D","AISSUE",ACHSISDT)) Q:ACHSISDT=""  Q:ACHSISDT>ACHSEDT  Q:ACHSISDT<ACHSBDT  D
 . S ACHSA=0 F  S ACHSA=$O(^ACHSDEN(DUZ(2),"D","AISSUE",ACHSISDT,ACHSA)) Q:ACHSA=""  D
 ..; I $P($G(^ACHSDEN(DUZ(2),"D",ACHSA,0)),U,8)="Y" Q
 ..; IHS/SET/JVK 3/20/2003 ADDED BELOW ACHS*3.1*6
 .. I $P($G(^ACHSDEN(DUZ(2),"D",ACHSA,0)),U,8)="Y" S ACHSYCN=ACHSYCN+1 Q
 .. ;
 .. ;010202  pmf  add next line
 .. ;Y means cancelled.  R means reversed
 .. ; IHS/SET/JVK 3/20/2003 COMMENT OUT BELOW ACHS*3.1*6
 .. ;I $P($G(^ACHSDEN(DUZ(2),"D",ACHSA,0)),U,8)="R" Q  ; ACHS*3.1*3
 .. ;
 .. ; IHS/SET/JVK 3/20/2003 ADDED BELOW ACHS*3.1*6
 .. I $P($G(^ACHSDEN(DUZ(2),"D",ACHSA,0)),U,8)="R" S ACHSRCN=ACHSRCN+1 Q  ; ACHS*3.1*6
 .. ;I $E($G(^ACHSDEN(DUZ(2),"D",ACHSA,0)))="#";IHS/SET/GTH ACHS*3.1*5 12/06/2002
 .. I $E($G(^ACHSDEN(DUZ(2),"D",ACHSA,0)))="#" Q  ;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 .. ;
 .. S ACHSNR=$P($G(^ACHSDEN(DUZ(2),"D",ACHSA,250)),U)
 .. I 'ACHSNR S ACHSNR=0
 .. S ACHS(ACHSNR)=$G(ACHS(ACHSNR))+1,ACHSTCN=ACHSTCN+1
 .. Q
 . Q
 ;
 D BRPT^ACHS,HDR
 ;
 ;ACHS*3.1*5 12/06/2002 pmf  the report was using the reason as a
 ;   subscript.  however, if more than one reason had the same
 ;   text on it, one would overwrite the other.
 ;   now we use the reason AND it's subscript when we place it
 ;   into the array for display.
 ;S ACHSNR=0 F  S ACHSNR=$O(ACHS(ACHSNR)) Q:+ACHSNR=0  S ACHSX($P($G(^ACHSDENS(ACHSNR,0)),U))=ACHS(ACHSNR);ACHS*3.1*5 12/06/2002
 S ACHSNR=0 F  S ACHSNR=$O(ACHS(ACHSNR)) Q:+ACHSNR=0  S ACHSREA=$P($G(^ACHSDENS(ACHSNR,0)),U),ACHSX(ACHSREA_U_ACHSNR)=ACHS(ACHSNR) ;ACHS*3.1*5 12/06/2002
 ;Begin New Code;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 I $D(ACHS(0)) S ACHSX("<Missing>^0")=ACHS(0)
 ;End New Code;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 ;
 ;S ACHSNR=0 F  S ACHSNR=$O(ACHSX(ACHSNR)) Q:ACHSNR=""  W ?5,ACHSNR,?65,$J($FN(ACHSX(ACHSNR),","),8),!! I $Y>ACHSBM D RTRN^ACHS Q:$G(ACHSQUIT)  D HDR;ACHS*3.1*5 12/06/2002
 S ACHSNR="" F  S ACHSNR=$O(ACHSX(ACHSNR)) Q:ACHSNR=""  W ?5,$P(ACHSNR,U),?65,$J($FN(ACHSX(ACHSNR),","),8),!! I $Y>ACHSBM D RTRN^ACHS Q:$G(ACHSQUIT)  D HDR ;ACHS*3.1*5 12/06/2002
 ;
 ;
 I $D(ACHSD(0)) W ?5,"<Primary Denial Reason MISSING>",?65,$J($FN(ACHS(0),","),8),!! I $Y>ACHSBM D RTRN^ACHS Q:$G(ACHSQUIT)  D HDR
 W !!,$$REPEAT^XLFSTR("-",79),!!?25,"TOTAL DOCUMENTS",?65,$J($FN(ACHSTCN,","),8)
 ;Begin New Code;IHS/SET/JVK ACHS*3.1*6 3/20/2003
 W !,?25,"TOTAL CANCELED: ",?65,$J($FN(ACHSYCN,","),8)
 W !,?25,"TOTAL REVERSED: ",?65,$J($FN(ACHSRCN,","),8)
 W !,?25,"GRAND TOTAL: ",?65,$J($FN((ACHSTCN+ACHSYCN+ACHSRCN),","),8)
 ;End New Code;IHS/SET/JVK ACHS*3.1*6 3/20/2003
 D ERPT^ACHS
 K ACHSYCN,ACHSRCN
 Q
 ;
HDR ; --- Paginate, write header
 W @IOF,!!,ACHSLOC,!,$$C^ACHS("CONTRACT HEALTH SERVICE DENIALS (HQ TABLE 1)",80),!,$$C^ACHS("From "_$$FMTE^XLFDT(ACHSBDT)_" To "_$$FMTE^XLFDT(ACHSEDT),80),!!,ACHSTIME,!,$$REPEAT^XLFSTR("=",79),!!!
 Q
 ;
END ;
 D ^%ZISC
 K ACHSBDT,ACHSEDT,ACHSQIO
 Q