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

ACHSSIGA.m

Go to the documentation of this file.
ACHSSIGA ;IHS/ITSC/JVK -PROGRAM TO LIST SIGNED PO'S WITH E-SIG [ 01/11/2005  7:31 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**7,19**;JUNE 11,2001
 ;;ACHS*3.1*7 - NEW ROUTINE E-SIG REPORT OF SIGNED PO'S
 ;;CALLED BY ACHSESIGRPT
 ;
TITLE ;;E-Signature Approved
 S ACHSIO=IO
 S ACHSCNT=0
 K X2,X3
BDT ;--ASK THE DATE RANGE--
 W !!,"This report captures documents signed over a specific dates range.",!
 S ACHSBDT=$$DATE^ACHS("B",$P($T(TITLE),";",3),"E-SIG")
 G K:$D(DUOUT)!$D(DTOUT)!(ACHSBDT<1)
EDT ;
 S ACHSEDT=$$DATE^ACHS("E",$P($T(TITLE),";",3),"E-SIG")
 G K:$D(DTOUT)!(ACHSEDT<1),BDT:$D(DUOUT)
 G:$$EBB^ACHS(ACHSBDT,ACHSEDT) EDT
DEV ;
 S %=$$PB^ACHS
 I %=U!$D(DTOUT)!$D(DUOUT) D K Q
 I %="B" D VIEWR^XBLM("PRINT^ACHSSIGA"),EN^XBVK("VALM"),K Q
 S %ZIS="OPQ"
 D ^%ZIS
 I POP D HOME^%ZIS G K
 G:'$D(IO("Q")) PRINT
 K IO("Q")
 I $D(IO("S"))!($E(IOST)'="P") W *7,!,"Please queue to system printers." D ^%ZISC G DEV
 ;ITSC/SET/JVK ACHS*3.1*12
 ;S ZTRTN="PRINT^ACHSDST",ZTIO="",ZTDESC=$P($T(TITLE),";",3)_", Type "_ACHSRPT_", "_$$FMTE^XLFDT(ACHSBDT)_" to "_$$FMTE^XLFDT(ACHSEDT),ACHSQIO=ION_";"_IOST_";"_IOM_";"_IOSL
 S ZTRTN="PRINT^ACHSSIGA",ZTIO="",ZTDESC=$P($T(TITLE),";",3)_", Type "_ACHSRPT_", "_$$FMTE^XLFDT(ACHSBDT)_" to "_$$FMTE^XLFDT(ACHSEDT),ACHSQIO=ION_";"_IOST_";"_IOM_";"_IOSL
 F ACHS="ACHSQIO","ACHSBDT","ACHSEDT" S ZTSAVE(ACHS)=""
 D ^%ZTLOAD
 G:'$D(ZTSK) DEV
K ;
 K ACHS,ACHSIO,ACHSQIO,ACHSBDT,ACHSEDT,ACHSRPT,ZTIO,ZTSK
 D ^%ZISC
 Q
PRINT ;
 D FC^ACHSUF
 I $D(ACHSERR),ACHSERR=1 K ZTSK G KILL
 D BRPT^ACHSFU
 S ACHST1=$$C^XBFUNC("Purchase Orders with Electronic Signature",80)
 S ACHST2=$$C^XBFUNC("Duing the Period of "_$$FMTE^XLFDT(ACHSBDT)_" through "_$$FMTE^XLFDT(ACHSEDT),80)
 D HDR
 S X3=0,ACHSBDT=ACHSBDT-1
LOOP1 ;--LOOP THRU THE "ESIG" CROSS REFERENCE--
 S ACHSBDT=$O(^ACHSF(DUZ(2),"ESIG",ACHSBDT))
 G END:+ACHSBDT=0!(+ACHSBDT>ACHSEDT)
 S DA=0
LOOP2 ;
 S DA=$O(^ACHSF(DUZ(2),"ESIG",ACHSBDT,DA))
 G LOOP1:+DA=0,LOOP1:'$D(^ACHSF(DUZ(2),"D",DA,0))
DATAFLD ;--GET THE DATA FIELDS FOR THE REPORT --
 S ACHSDOC1=$P(^ACHSF(DUZ(2),"D",DA,0),U),ACHSDOC2=$P(^(0),U,14)
 S ACHSVPTR=$P(^ACHSF(DUZ(2),"D",DA,0),U,8)
 S ACHSODT=$P(^ACHSF(DUZ(2),"D",DA,0),U,2)
 S ACHS("$")=$P(^ACHSF(DUZ(2),"D",DA,0),U,9),ACHSESIG=$P(^(0),U,24)
 S:'$P(^ACHSF(DUZ(2),"D",DA,0),U,3) ACHSPAT=$P(^(0),U,22),ACHSPAT=$P(^DPT(ACHSPAT,0),U)
 I $P(^ACHSF(DUZ(2),"D",DA,0),U,3)=1 S ACHSPAT="BLANKET ORDER"   ;ACHS*3.1*19
 S ACHSESIG=$P(^VA(200,ACHSESIG,0),U)
 S ACHSESIG=$P(ACHSESIG,",",2)_" "_$P(ACHSESIG,",",1)
 ;**TESTING**
 S ACHSASIG=$P($G(^ACHSF(DUZ(2),"D",DA,0)),U,29),ACHSADT=$P($G(^(0)),U,30)
 I ACHSASIG S ACHSASIG=$P(^VA(200,ACHSASIG,0),U),ACHSASIG=$P(ACHSASIG,",",2)_" "_$P(ACHSASIG,",",1)
 ;I 'ACHSASIG,$P(^ACHSESIG(DUZ(2),0),U,2)=0 S ACHSASIG=""
 I ACHSASIG="",$P(^ACHSESIG(DUZ(2),0),U,2)=1 S ACHSASIG="NEEDS AUTH. OFC. SIG"
 ;** END TESTING**
 G LOOP1:ACHSVPTR']"",LOOP1:'$D(^AUTTVNDR(ACHSVPTR,0)) S ACHSVNDR=$P(^(0),U)
 S ACHSDOC=ACHSDOC2_"-"_ACHSFC_"-"_ACHSDOC1
 W !,ACHSDOC,?20,$E(ACHSVNDR,1,26),?48,$E(ACHSBDT,4,7),$E(ACHSBDT,2,3),?58,ACHSESIG,!
 ;W ACHSPAT,?48,$E(ACHSODT,4,7),$E(ACHSODT,2,3),?58,$FN(ACHS("$"),",",2),!
 W ACHSPAT,?20,$FN(ACHS("$"),",",2),?48,$E(ACHSODT,4,7),$E(ACHSODT,2,3),?58,ACHSASIG,!
 S ACHSCNT=ACHSCNT+1
 G LOOP2
HDR ;
 S ACHSPG=ACHSPG+1
 W @IOF,!!,ACHSUSR,?71,"Page",$J(ACHSPG,3),!,$$C^XBFUNC("***  CONTRACT HEALTH MANNAGEMENT SYSTEM  ***",80),!!,ACHSLOC,!?29,"ELECTRONIC SIGNATURE REPORT"
 I $D(ZTQUEUED) W ?77-$L(ZTSK),"(",ZTSK,")"
 W !,ACHSTIME,!,ACHST1,!,ACHST2,!!,"Document Number",?20,"Provider of Service",?48,"Sig Date",?58,"Ordering Official",!
 W "Patient",?20,"Oligation Amt.",?48,"Order Dt.",?58,"Authorizing Official",!,$$REPEAT^XLFSTR("=",79),!
 Q
END ;
 W !,$$REPEAT^XLFSTR("-",79),!
 W "Total Documents: ",ACHSCNT,!
 D RTRN^ACHS
 W @IOF
KILL ;
 I $D(ZTQUEUED) K ACHSFC
 D ERPT^ACHS
 K ACHSDOC,ACHSDOC1,ACHSDOC2,ACHSESIG,ACHSVNDR,ACHSCNT
 K DA,DFN,X2,X3
 Q