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

ACHSDFI.m

Go to the documentation of this file.
ACHSDFI ; IHS/ITSC/PMF - DEFERRED SERVICES LIST BY ISSUE DATE ;7/27/10  16:09
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**18**;JUN 11, 2001
 ;ACHS*3.1*18 4/1/2010;IHS/OIT/ABK;Change every occurrance of Deferred to Unmet Need
 ;
 K X2,X3
A2 ; --- All or date range
 ;{ABK, 3/31/10}S %=$$DIR^ACHS("Y","ALL DEFERRED SERVICES","YES","Enter 'NO' to select the date range for the denial list","",2)
 S %=$$DIR^ACHS("Y","ALL UNMET NEEDS","YES","Enter 'NO' to select the date range for the denial list","",2)
 G K:$D(DUOUT)!$D(DTOUT)
 I % S ACHDBDT=1,ACHDEDT=9999999 G B
 ;
BDT ; --- Beginning date
 ;{ABK, 3/31/10}S ACHDBDT=$$DATE^ACHS("B","DEFERRED SERVICES LIST")
 S ACHDBDT=$$DATE^ACHS("B","UNMET NEEDS LIST")
 G:ACHDBDT<1 A2
 ;
A3 ; --- Ending date
 ;{ABK, 3/31/10}S ACHDEDT=$$DATE^ACHS("E","DEFERRED SERVICES LIST")
 S ACHDEDT=$$DATE^ACHS("E","UNMET NEEDS LIST")
 G:ACHDEDT<1 BDT
 I $$EBB^ACHS(ACHDBDT,ACHDEDT) G BDT
B ;
 S ACHDHAT=""
DEV ;
 S %ZIS="OPQ"
 D ^%ZIS
 I POP D HOME^%ZIS G K
 G:'$D(IO("Q")) START
 K IO("Q")
 I $D(IO("S"))!($E(IOST)'="P") W *7,!,"Please queue to system printers." D ^%ZISC G DEV
 ;{ABK, 3/31/10}S ZTRTN="START^ACHSDNI",ZTDESC="CHS Deferred Services Documents"_$$FMTE^XLFDT(ACHDBDT)_" to "_$$FMTE^XLFDT(ACHDEDT)
 S ZTRTN="START^ACHSDNI",ZTDESC="CHS Unmet Needs Documents"_$$FMTE^XLFDT(ACHDBDT)_" to "_$$FMTE^XLFDT(ACHDEDT)
 F %="ACHDBDT","ACHDEDT" S ZTSAVE(%)=""
 D ^%ZTLOAD
 G:'$D(ZTSK) DEV
 K ZTSK
 G K
 ;
START ;EP - TaskMan.
 ;{ABK, 3/31/10}S ACHDISU=ACHDBDT-1,(ACHDTOT("$"),ACHDTOT)=0,ACHDT1=$$C^ACHS($S(ACHDBDT=1:"***   ALL DEFERRED SERVICES   ***",1:"For the period "_$$FMTE^XLFDT(ACHDBDT)_" through "_$$FMTE^XLFDT(ACHDEDT)),80)
 S ACHDISU=ACHDBDT-1,(ACHDTOT("$"),ACHDTOT)=0,ACHDT1=$$C^ACHS($S(ACHDBDT=1:"***   ALL UNMET NEEDS   ***",1:"For the period "_$$FMTE^XLFDT(ACHDBDT)_" through "_$$FMTE^XLFDT(ACHDEDT)),80)
 D BRPT^ACHS
 D HDR
 ;
L1 ;
 S ACHDISU=$O(^ACHSDEF(DUZ(2),"D","AISSUE",ACHDISU))
 G END:+ACHDISU=0!(ACHDISU>ACHDEDT)
 S ACHSA=0
L2 ;
 S ACHSA=$O(^ACHSDEF(DUZ(2),"D","AISSUE",ACHDISU,ACHSA))
 G L1:+ACHSA=0
 G L2:'$D(^ACHSDEF(DUZ(2),"D",ACHSA,0))
 G L2:$E($G(^ACHSDEF(DUZ(2),"D","AISSUE",ACHDISU,ACHSA,0)))="#"  ;INCOMPLETE
 ;{ABK, 3/31/10}G L2:$$DF^ACHS(0,14)="Y"  ;'DEFERRED SERVICE CANCELLED'
 G L2:$$DF^ACHS(0,14)="Y"  ;'UNMET NEED CANCELLED'
 ;
 ;'IS PATIENT REGISTERED?'  NO GO GET NAME IF NOT THERE
 I $$DF^ACHS(0,5)="N" G L2:'$L($$DF^ACHS(0,7)) S ACHDNAME=$$DF^ACHS(0,7) G L3
 G L2:'$$DF^ACHS(0,6)            ;'REGISTERED PATIENT' PTR
 G L2:'$D(^DPT($$DF^ACHS(0,6),0))
 S ACHDNAME=$P($G(^DPT($$DF^ACHS(0,6),0)),U)   ;REG. PAT. NAME
L3 ;
 S ACHD("$")=""
 W $$FMTE^XLFDT(ACHDISU)   ;'SERVICE DATE ISSUED'
 W ?14,$$DF^ACHS(0,1)      ;'CHS DEFERRED SERVICE FACILITY'
 W ?27,ACHDNAME,?65
 S X=$$DF^ACHS(100,5),X2=2,X3=12
 D FMT^ACHS
 W !
 I $Y>ACHSBM D RTRN^ACHS G K:$D(DUOUT)!$D(DTOUT)!($G(ACHSQUIT)) D HDR
 S ACHDTOT=ACHDTOT+1
 S ACHDTOT("$")=ACHDTOT("$")+$$DF^ACHS(100,5)    ;'ESTIMATED COST'
 G L2
 ;
END ;
 S X=ACHDTOT("$"),X2="2$",X3=16
 D COMMA^%DTC
 ;{ABK, 3/31/10}W !,$$REPEAT^XLFSTR("=",79),!,"TOTALS FOR THIS REPORT: ",ACHDTOT," DEFERRED SERVICE",$S(ACHDTOT=1:"",1:"S"),?61,X
 W !,$$REPEAT^XLFSTR("=",79),!,"TOTALS FOR THIS REPORT: ",ACHDTOT," UNMET NEED",$S(ACHDTOT=1:"",1:"S"),?61,X
 K ACHDHAT
 D RTRN^ACHS
 W @IOF
 ;
K ; --- Kill, End, Quit
 K ACHD,ACHDISU,ACHDNAME,ACHDTOT,ACHSA
 D ERPT^ACHS
 Q
 ;
HDR ; --- Paginate, write headers
 S ACHSPG=ACHSPG+1
 ;{ABK, 3/31/10}W @IOF,!!,$$C^ACHS("***  CHS DENIAL/DEFERRED SERVICES  ***",80),!!,ACHSLOC,!?20,"DEFERRED SERVICES DOCUMENTS BY ISSUE DATE",?71,"Page",$J(ACHSPG,3)
 W @IOF,!!,$$C^ACHS("***  CHS UNMET NEEDS  ***",80),!!,ACHSLOC,!?20,"UNMET NEEDS DOCUMENTS BY ISSUE DATE",?71,"Page",$J(ACHSPG,3)
 W !,ACHSTIME,!!,ACHDT1,!!,"ISSUE DATE",?14,"DOCUMENT #",?27,"PATIENT",?69,"DOLLARS",!,$$REPEAT^XLFSTR("=",79),!
 Q
 ;