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

ACHSSIG2.m

Go to the documentation of this file.
ACHSSIG2 ;IHS/ITSC/JVK-STAMP ELECTRONIC SIGNATURE OF AUTHORIZING OFC. ON PO [ 01/11/2005  7:33 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**7,8,9,12**;JUNE 11,2001 
 ;;ACHS*3.1*7-ALLOWING AUTHRIZING OFFICIAL E SIG
 ;;ACHS*3.1*8-FIX LIST FOR SPECIAL LOCALS
 ;;NEW ROUTINE CALLED FROM ACHS E-SIG MENU OPTION
 ;;3.1 8.23.04 IHS/ITSC/FCJ LOOP WAS NOT PICKING UP DOCUMENTS IF TYPE 1
 ;     DID NOT EXIST
 ;
LOOK ;EP
 S ACHSANS=""
 I '$D(^ACHSF("EAQ",DUZ(2))) D  Q
 . W !,"There are no documents in the Queue!"
 . D RTRN^ACHS
 S ACHSIO=IO
 K X2,X3
 ;
START ;
 D BM^ACHS
 S ACHSFC=$$FC^ACHS(DUZ(2))
 S COUNT=0
 S ACHSQUIT=0
 S ACHSMULT=$P(^ACHSESIG(DUZ(2),0),U,2)
 I 'ACHSMULT W !!!,?5,"YOUR SITE PARAMETERS INDICATE THIS IS NOT A MULTIPLE SIGNATURE SITE.",!,?5,"THIS OPTION IS NOT AVAILABLE FOR USE." H 3 D END Q
 D CHECK
 I ACHSQUIT G END
 ;
LOOP1 ;--LOOP THRU QUEUE ARRAY FOR DOCUMENTS WAITING --
 ;ITSC/SET/JVK ACHS**
 S ACHSGO=0
 F ACHSTYPV=1,3,2  D LOOP2 Q:$D(DUOUT)!ACHSQUIT
 ;
 I ACHSGO>0,ACHSSIG'=""  G A
 ;
 ;ITSC/SET/JVK ACHS*3.1*12
 ;I 'ACHSGO W !,?5,"No Documents Pending for your Signature.",! H 2 G END
 I ACHSGO'>0 W !,?5,"No Documents Pending for your Signature.",! H 2 G END
 ;
 I $D(DUOUT)!$D(DTOUT) D END Q
 ;
LOOP2 ;--SECOND LEVEL OF QUEUE ARRAY SET UP ACHSTMP ARRAY--
 Q:'$D(^ACHSF("EAQ",DUZ(2),ACHSTYPV))  ;8.23.04 IHS/ITSC/FCJ TEST FOR DOC TYPE
 S ACHSDIEN=""
 S ACHSFLG=""
 F  S ACHSDIEN=$O(^ACHSF("EAQ",DUZ(2),ACHSTYPV,ACHSDIEN)) Q:+ACHSDIEN=0!$D(DUOUT)  D
 .S ACHSDOC=^ACHSF(DUZ(2),"D",ACHSDIEN,0)
 .S ACHSTST1=$P(ACHSDOC,U,24)
 .S ACHSTST2=$P(ACHSDOC,U,29)
 .;TEST FOR ORDER AND AUTHROIZING NOT TO BE THE SAME PERSON
 .I ACHSTST1=DUZ Q
 .S ACHSAMT=$P(ACHSDOC,U,9)
 .I ACHSAMT>ACHSDAMT Q
 .I ACHSTST2="" S COUNT=COUNT+1,ACHSTMP(DUZ(2),COUNT)=ACHSDIEN_U_ACHSAMT,ACHSFLG=1
 .S ACHSGO=COUNT
 Q
 ;
A ;--SET UP LIST MANAGER--
 D VIEWR^XBLM("PRINT^ACHSSIG2")
 D STAMP
 Q
 ;
PRINT ;
 D FC^ACHSUF
 D BRPT^ACHSFU
 S ACHST1=$$C^XBFUNC("Purchase Orders to be Approved",80)
 D HDR
 S X3=0
 S COUNT=""
 F  S COUNT=$O(ACHSTMP(DUZ(2),COUNT)) Q:COUNT'?1N.N  D
 .S ACHSDOC=^ACHSF(DUZ(2),"D",$P(ACHSTMP(DUZ(2),COUNT),U),0)
 .S ACHSTYP=$P(ACHSDOC,U,4)
 .S ACHSLST=$S(ACHSTYP=1:"Hospital",ACHSTYP=3:"Outpatient",ACHSTYP=2:"Dental",1:"")
 .D LIST
 Q
 ; 
CHECK ;--IS THE USER AUTHORIZED IN THE CHS E-SIG FILE--
 S ACHSAU=""
 S ACHSAU=$O(^ACHSESIG(DUZ(2),1,"B",DUZ,ACHSAU))
 I ACHSAU D
 .K DIC,DIQ
 .S DIC=9002080.1,DR=".01;1",DA=DUZ(2)
 .S DR(9002080.11)="1:2:3",DA(9002080.11)=ACHSAU,DIQ="ACHSVAL" D EN^DIQ1
 .S ACHSDAMT=$P($G(ACHSVAL(9002080.11,ACHSAU,1)),U)
 .S ACHSADT=$P($G(ACHSVAL(9002080.11,ACHSAU,2)),U)
 .S ACHSIADT=$P($G(ACHSVAL(9002080.11,ACHSAU,3)),U)
 .S ACHSIGO=$P($G(ACHSVAL(9002090.11,ACHSAU,4)),U) ;ORDERING OFFICIAL
 .S ACHSIGA=$P($G(ACHSVAL(9002090.11,ACHSAU,5)),U) ;AUTHORIZING OFFICAL
 .Q
 D SIG^XUSESIG
 S ACHSSIG=X1
 I 'ACHSAU W !,"You are not authorized in the CHS E-SIG file.",! H 2 S ACHSQUIT=1 Q
 I ACHSIGA["NO",ACHSIGA="" W !,"You are not an authorized Authorizing Official.",! H 2 S ACHSQUIT=1
 Q
STAMP ;--ASK IF YOU WANT ALL OR REMOVE ITEMS FROM LIST OF SET--
 I ACHSSIG'="" S ACHSANS=$$DIR^XBDIR("Y","Do you want ALL documents stamped with your Electronic signature ","N","","","",1)
 I $D(DUOUT)!$D(DTOUT) D END Q
 I ACHSANS D LOOP3,END Q
 I 'ACHSANS D RMITMS,ASK
 Q
LIST ;--LIST ONLY THOSE PO W/OUT SIG IN FILE--
 W !,COUNT,?9,$P(ACHSDOC,U,14)_"-"_ACHSFC_"-"_$P(ACHSDOC,U,1) ;Order No
 W ?25,$P(^AUTTVNDR($P(ACHSDOC,U,8),0),U) ;Vendor
 W ?55,$FN($P(ACHSDOC,U,9),",",2) ;Total Amount Obligated
 ;W !,?9,"CAN-OCC-SCC: ",$P(^ACHS(2,$P(ACHSDOC,U,6),0),U),"-",$P(^ACHSOCC($P(ACHSDOC,U,7),0),U),"-",$P(^ACHS(3,DUZ(2),1,$P(ACHSDOC,U,10),0),U),?50,ACHSLST ;CAN & Obj Class
 W !,?9,"CAN-OCC-SCC: ",$P(^ACHS(2,$P(ACHSDOC,U,6),0),U),"-",$P(^ACHSOCC($P(ACHSDOC,U,10),0),U),"-",$P(^ACHS(3,DUZ(2),1,$P(ACHSDOC,U,7),0),U),?50,ACHSLST ;CAN & Obj Class
 ;ITSC/SET/JVK 2-18-2004
 ;W:$P(ACHSDOC,U,3)'=1 !,?9,$P(^DPT($P(ACHSDOC,U,22),0),U),! ;Patient
 I $P(ACHSDOC,U,3)=0 W !,?9,$P(^DPT($P(ACHSDOC,U,22),0),U),! ;Patient
 I $P(ACHSDOC,U,3) W !,?9,"--Blanket Order/Special Local--",!
 Q
RMITMS ;--REMOVE THE ITEM FROM THE SET--
 S ACHSQUE=$$DIR^XBDIR("L^0:1000","Select the ITEM NO. that you DO NOT want your Electronic signature applied to ","","Enter zero for none.","","",2)
 I ACHSQUE["^" G END Q
 I $D(DUOUT)!$D(DTOUT) G ASK
 ;I Y'=0,'$D(ACHSTMP(DUZ(2),Y)) D RMITMS         ;TEST FOR NUMBERS ALREADY GONE
 I Y=0 Q
 S ACHSITM=0
 F ACHSI=1:1 Q:ACHSITM=""  D
 .S ACHSITM=$P(Y,",",ACHSI)
 .Q:ACHSITM=""
 .Q:ACHSITM=0
 .Q:'$D(ACHSTMP(DUZ(2),ACHSITM))
 .K ACHSTMP(DUZ(2),ACHSITM)
 .Q
 Q
LOOP3 ;--STUFF THE USER AND DATE OF ALL AUTHORIZED--
 S COUNT=""
 S ACHSSUM=0
 F  S COUNT=$O(ACHSTMP(DUZ(2),COUNT)) Q:COUNT'?1N.N  D
 .S ACHSDOC=^ACHSF(DUZ(2),"D",$P(ACHSTMP(DUZ(2),COUNT),U),0)
 .S ACHSDIEN=$P(ACHSTMP(DUZ(2),COUNT),U)
 .S ACHSAMT=$P(ACHSTMP(DUZ(2),COUNT),U,2) ;DOCUMENT AMOUNT
 .S ACHSTYPV=$P(ACHSDOC,U,4)
 .I ACHSAMT>ACHSDAMT W !,?5,$P(ACHSDOC,U,14)_"-"_ACHSFC_"-"_$P(ACHSDOC,U,1)," Sorry this document exceeds your delegation of authority",!
 .I ACHSAMT<ACHSDAMT+1,'ACHSIADT,'$$DIE^ACHS("13.71////"_DUZ)
 .I ACHSAMT<ACHSDAMT+1,'ACHSIADT,'$$DIE^ACHS("13.72////"_DT)
 .S ACHSSUM=ACHSSUM+1
 .;ITSC/SET/JVK - ACHS****
 .;K ^ACHSF("EAQ",DUZ(2),ACHSTYPV,ACHSDIEN)
 .I $P(^ACHSF(DUZ(2),"D",ACHSDIEN,0),U,29)?1N.N,$P(^(0),U,30)?1N.N  K ^ACHSF("EAQ",DUZ(2),ACHSTYPV,ACHSDIEN)
 .Q
 W !,?5,ACHSSUM," DOCUMENTS APPROVED",! H 2
 G END
 ;
ASK ;
 S ACHSDONE=""
 W !!,?10,"Answering YES will remove the items you do not want approved"
 W !?10,"from the viewing list and approve all others.",!
 W !?10,"Answering NO will remove the items you already selected"
 W !?10,"from the viewing list and allow you to remove additional items.",!
 W !?10,"If you do not want to approve anything select all the items or"
 W !?10,"enter ^.  This approves nothing.",!!
 S ACHSDONE=$$DIR^XBDIR("Y","ARE YOU DONE","N","","Enter Y or N.",1)
 I $D(DUOUT)!$D(DTOUT) D END Q
 I 'ACHSDONE D VIEWR^XBLM("PRINT^ACHSSIG2"),RMITMS,ASK Q
 I ACHSDONE,ACHSQUE'["0" D VIEWR^XBLM("LOOP3^ACHSSIG2") Q
HDR ;
 S ACHSPG=ACHSPG+1
 W @IOF,!!,ACHSUSR,?71,"Page",$J(ACHSPG,3),!,$$C^XBFUNC("***  CONTRACT HEALTH MANAGEMENT SYSTEM   ***",80),!!,ACHSLOC,!
 W ACHSTIME,!,ACHST1
 W !!,"ITEM NO.",?9,"PO No.",?25,"Vendor",?50,"Obligation Amt",!,$$REPEAT^XLFSTR("=",79),!
 Q
END ;
 D EN^XBVK("VALM")
 K DIC,DIQ,X1,ACHSDIEN,ACHSAU,ACHSANS,ACHSVAL,ACHSDOC,ACHSTMP(DUZ(2)),ACHSLST,ACHSTYPV,ACHSADT,ACHSTST,COUNT,ACHSSIG,ACHSTYP
 D ^%ZISC
 Q