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

ACHSSIGB.m

Go to the documentation of this file.
ACHSSIGB ;IHS/ITSC/JVK -PROGRAM TO LIST UNSIGNED PO'S WAITING FOR E-SIG [ 01/11/2005  7:31 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**7**;JUN 11,2001
 ;;ACHS*3.1*7 - NEW ROUTINE PENDING E-SIG REPORT
 ;;CALLED BY ACHSESIGRPT
 ;
TITLE ;;PENDING E-SIG
 S ACHSIO=IO
 S ACHSCNT=0
 K X2,X3
BDT ;--ASK THE DATE RANGE--
 ;S ACHSBDT=$$DATE^ACHS("B",$P($T(TITLE),";",3),"ISSUE")
 ;G K:$D(DUOUT)!$D(DTOUT)!(ACHSBDT<1)
DEV ;
 S %=$$PB^ACHS
 I %=U!$D(DTOUT)!$D(DUOUT) D K Q
 I %="B" D VIEWR^XBLM("PRINT^ACHSSIGB"),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),ACHSQIO=ION_";"_IOST_";"_IOM_";"_IOSL
 S ZTRTN="PRINT^ACHSSIGB",ZTIO="",ZTDESC=$P($T(TITLE),";",3)_", Type "_ACHSRPT_", "_$$FMTE^XLFDT(ACHSBDT),ACHSQIO=ION_";"_IOST_";"_IOM_";"_IOSL
 F ACHS="ACHSQIO","ACHSBDT" S ZTSAVE(ACHS)=""
 D ^%ZTLOAD
 G:'$D(ZTSK) DEV
K ;
 K ACHS,ACHSIO,ACHSQIO,ACHSBDT,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 Pending for Electronic Signature",80)
 S ACHST2=$$C^XBFUNC("Run date of "_$$FMTE^XLFDT(DT),80)
 D HDR
 S X3=0
LOOP1 ;--LOOP THRU THE ^ACHS("EQ",DUZ(2),ACHSTYP) CROSS REFERENCE--
 F ACHSTYP=1,3,2 D  Q:+ACHSTYP=0
 .D LOOP2
 G END
 ;Q
LOOP2 ;--LOOP TO GET DOC NUMBER--
 S DA=0
 F  S DA=$O(^ACHSF("EQ",DUZ(2),ACHSTYP,DA)) Q:+DA=0  D
 .S ACHSTEST=$P(^ACHSF(DUZ(2),"D",DA,0),U,24)
 .I 'ACHSTEST  D DATAFLD
 Q
DATAFLD ;--GET THE DATA FIELDS FOR THE REPORT --
 S ACHSDOC1=$P($G(^ACHSF(DUZ(2),"D",DA,0)),U),ACHSDOC2=$P(^(0),U,14)
 S ACHSVPTR=$P(^ACHSF(DUZ(2),"D",DA,0),U,8)
 S ACHSIDT=$P(^ACHSF(DUZ(2),"D",DA,0),U,2)
 S ACHS("$")=$J($FN($P(^ACHSF(DUZ(2),"D",DA,0),U,9),",",2),8)
 S ACHSVTYP=$S(ACHSTYP=1:"Hospital",ACHSTYP=3:"Outpatient",ACHSTYP=2:"Dental",1:"")
 I $D(^AUTTVNDR(ACHSVPTR,0)) S ACHSVNDR=$P(^(0),U)
 S ACHSDOC=ACHSDOC2_"-"_ACHSFC_"-"_ACHSDOC1
 W ACHSDOC,?20,$E(ACHSVNDR,1,26),?48,$E(ACHSIDT,4,7),$E(ACHSIDT,2,3),?60,ACHS("$"),?70,ACHSVTYP,!
 S ACHSCNT=ACHSCNT+1
 Q
HDR ;
 S ACHSPG=ACHSPG+1
 W @IOF,!!,ACHSUSR,?71,"Page",$J(ACHSPG,3),!,$$C^XBFUNC("***  CONTRACT HEALTH MANNAGEMENT SYSTEM  ***",80),!!,ACHSLOC,!?22,"PENDING ELECTRONIC SIGNATURE REPORT"
 I $D(ZTQUEUED) W ?77-$L(ZTSK),"(",ZTSK,")"
 W !,ACHSTIME,!,ACHST1,!,ACHST2,!!,"Document Number",?20,"Provider of Service",?45,"Issue Date",?58,"Obligation Amt.",?74,"Type",!,$$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,ACHSIDT,ACHSVNDR,ACHSCNT
 K DA,DFN,X2,X3
 Q