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

ACRFEA4.m

Go to the documentation of this file.
ACRFEA4 ;IHS/OIRM/DSD/THL,AEF - EDIT FINANCIAL DATA;  [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;CONTINUATION OF ACRFEA
CURRENT ;EP;TO CONTROL EDITING OF ACCOUNT DATA AND REQUESTS
 I '$D(ACRFDNO),'$D(ACRDOCDA) S ACRQUIT="" Q
 S ACRCANDA=$G(ACRCANDA)
 S ACRLBOC=$G(ACRLBOC)
 ;IF ACRENTRY CONTAINS 'OBL' DATA BEING EDITED IS ALWAYS FOR SPECIFIC
 ;FINANCIAL DOCUMENT
 K ACROUT
 I ACRENTRY["OBL",'$D(ACRNEWOB),'$D(ACRREV),"^116^204^130^600^148^"[(U_ACRREF_U)!$D(ACRPO),'$D(ACRREACT) D  Q
 .D EDIT^ACRFEA41
 .I "^130^600^"[(U_ACRREF_U) D RECEIPTS^ACRFSS4,TAXI^ACRFSS4
 I ACRENTRY["OBL",$D(ACRDOCDA) D  I '$D(ACRNEWOB) Q:$D(ACRREACT)
 .I $D(^ACRAPVS("AB",ACRDOCDA)) D ^ACRFDISA
 .I $D(ACRREACT) D REACT Q
 .I $P(ACRDOC0,U,4)'=35 F  D ACRDIE^ACRFEA2 Q:$D(ACRQUIT)!$D(ACROUT)!$D(ACRREV)!$D(ACROUT)
 .Q:$D(ACROUT)
 .I ACRREF=130 D 14^ACRFEA41
 .K ACRQUIT
 Q:$D(ACRQUIT)!$D(ACROUT)
 I $D(ACRNEWOB)!$D(ACRNEW),$G(ACRREF)'=148 D EDIE1^ACRFEA2 K ACRNEW Q:$D(ACRQUIT)!$D(ACROUT)
 I $D(ACRNEWOB) D
 .S:'$D(ACRREFX) ACRREFX=ACRREF
 .D:ACRREFX=116 EN^ACRFEA43
 I ACRENTRY["OBL",$D(ACRDOCDA),'$D(ACRREV),'$D(ACRPO),$P(ACRDOC0,U,4)'=35 D
 .I ACRREF'=148 D
 ..D SCREEN^ACRFAU
 ..I $D(ACRSCREN) K ACRSCREN Q
 ..D DISP^ACRFEA42
 .N ACRI
 .I ACRREF=148 D  Q
 ..D COURSE^ACRFSS3
 ..D REMARKS^ACRFEA43
 .D EDIE^ACRFEA2
 I ACRENTRY["OBL",$D(ACRDOCDA),'$D(ACROUT) D
 .D ^ACRFSS
 .I $D(^ACRSS("C",ACRDOCDA)) D
 ..I '$D(ACRREV),$G(ACRREF)'=130,$G(ACRREF)'=148,$P(ACRDOC0,U,4)'=35 D ATTACH^ACRFEA42
 ..I '$D(ACRREV),'$D(ACRPO),$D(^ACRDOC(ACRDOCDA,"PO")),'$P(^ACRDOC(ACRDOCDA,"PO"),U,5) D RV^ACRFEA42
 ;IF ACRENTRY DOES NOT CONTAIN 'OBLA' EDITING IS ALWAYS FOR A FINANCIAL
 ;ACCOUNT
 I ACRENTRY'["OBLA",'$D(ACRPO),'$D(ACRSS6) D  S ACRQUIT="" Q
 .S DA=ACRZDA
 .S DIE=ACRDIE
 .S DR=ACRDR
 .D DDS^ACRFDIC
 .I '$D(ACRSCREN),ACRENTRY'["APP" D
 ..S DR=$P(DR,"INFO]")_"PURPOSE]"
 ..D DDS^ACRFDIC
 .I $D(ACRSCREN) K ACRSCREN D
 ..D DISP^ACRFEA42
 ..W !
 ..N ACRI
 ..D EDIE^ACRFEA2
 .I ACRENTRY["LOCB" D
 ..S DIR("A")="    Edit ACCOUNT ACCESS? "
 ..S ACRDR="[ACR DEPARTMENT ACCT ACCESS]"
 ..N ACRI
 ..K ACRQUIT
 ..S DA=ACRZDA
 ..S DIE=ACRDIE
 ..S DR=ACRDR
 ..D DDS^ACRFDIC
 ..I $D(ACRSCREN) K ACRSCREN D EDIE^ACRFEA2
 ..D ^ACRFLBTX
 .D DHR:ACRDIC["ACRALC"
 Q:$D(ACROUT)
 I ACRENTRY["OBL",'$D(ACRPO),'$D(ACRSS6),'$D(ACRPRT) D ASUM^ACRFEA42
 I $D(ACRREV) D
 .S D0=ACRDOCDA
 .D ^ACRFPAPV
 Q:$D(ACRREV)
 D SETDOC^ACRFEA1
 D ^ACRFEA41
 K ACRQUIT
 Q
REACT ;EP;
 D OBLSTAT
 Q:$D(ACRQUIT)
 S DIR("A")="Return Document "_$P(ACRDOC0,U)_" to initiator ? "
 W !
 D OUT^ACRFEA2
 Q:$D(ACROUT)!$D(ACRQUIT)
 Q:ACRY'=1
 S ACRTXDA=$P(ACRDOC0,U,4)
 S ACRREFDA=$P(ACRDOC0,U,13)
 S ACRREF=$P(^AUTTDOCR(ACRREFDA,0),U)
 S ACRREF=$S("^116^204^103^349^326^210^"[(U_ACRREF_U):116,ACRREF=130:130,ACRREF=600:600,ACRREF=148:148,1:116)
 I ACRREF=600 D  Q:$D(ACRQUIT)
 .S DIR("0")="SO^1:Reprocess TRAVEL ORDER;2:Reprocess TRAVEL VOUCHER"
 .S DIR("A")="Which one"
 .S DIR("B")="Reprocess TRAVEL ORDER"
 .W !
 .D DIR^ACRFDIC
 .S:ACRY=1 ACRREF=130
 S:ACRREF=600 ACRTXDA=19
 S DA=ACRDOCDA
 S DIE="^ACROBL("
 S DR=$S(ACRREF'=600:"903///@;905///@;906///@;910///@",1:"903////A;905////A;906////Y")_";.1///"_ACRREF_";911///@;907////"_ACRTXDA
 D DIE^ACRFDIC
 D:ACRREF'=600 KILL^ACRFAPVS
 S DA=ACRDOCDA
 S DIE="^ACRDOC("
 S DR=".13///"_ACRREF_";.14////"_$P($P(^ACRDOC(ACRDOCDA,0),U,14),"CANCELLED ",2)_";.2///@;.3///@;.4///@"
 D DIE^ACRFDIC
 S ACRREFDA=$P(^ACRDOC(ACRDOCDA,0),U,13)
 D KILL^ACRFAPVS
 S ACRY=1
 Q
RESP ;EP;CHECK TO SEE IF RESPONSE TO APPROVAL RETURN IS REQUIRED
 S ACRRESP=$G(^ACRDOC(ACRDOCDA,"DT"))
 I +ACRRESP'=1!($P(ACRRESP,U,2)=1)!('$P(ACRRESP,U,10)) K ACRRESP Q
 S ACREND=ACREND+1
 W *7,*7
 W !?5,"***  "
 W ?10,ACREND
 W ?15,@ACRON,"Response REQUIRED to Approval Inquiry"
 W ?45,@ACROF,"  ***"
 Q
FEDSET ;EP;
 D DOC1^ACRFFS
 S DA=ACRDOCDA
 S DIE="^ACRDOC("
 S DR="14///GSA;15///A0A;16////"_ACRFLDA_";17////"_ACRFINDA_";18////B"
 D DIE^ACRFDIC
 Q
DHR ;EP;DETERMINE IF ALLOWANCE DHR SHOULD BE CREATED
 Q:$P($G(^ACRSYS(1,"DT1")),U,6)'=1
 I '+$G(^ACRALC(ACRZDA,0)) D  Q
 .W !!,"This account has no dollar value to report to HAS."
 .D PAUSE^ACRFWARN
 I $P($G(^ACRALC(ACRZDA,0)),U,19) S ACRDHRDA=$P(^(0),U,19) D  Q
 .W !,"DHR ",@ACRON,$P($G(^ACRDHR(ACRDHRDA,0)),U),@ACROF," has been created for this advice of allowance."
 .N DXS,DIP
 .S D0=ACRDHRDA
 .D ^ACRDHR
 .D PAUSE^ACRFWARN
 .Q:$D(ACRQUIT)
 .S DIR(0)="YO"
 .S DIR("A",1)="Do you need to RE-CREATE the"
 .S DIR("A")="DHR for this ADVICE OF ALLOWANCE"
 .S DIR("B")="NO"
 .W !
 .D DIR^ACRFDIC
 .Q:$G(Y)'=1
 .W !!,"Please note - this will delete the existing DHR and create"
 .W !,"a new DHR for this Advice of Allowance.  Are you certain"
 .W !,"you wish to proceed."
 .S DIR(0)="YO"
 .S DIR("A")="RE-CREATE the DHR"
 .S DIR("B")="NO"
 .W !
 .D DIR^ACRFDIC
 .Q:$G(Y)'=1
 .S DA=$P(^ACRALC(ACRZDA,0),U,19)
 .S DIK="^ACRALC("
 .D DIK^ACRFDIC
 .D D1
 S DIR(0)="YO"
 S DIR("A")="Create DHR for this ADVICE OF ALLOWANCE"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q:$G(Y)'=1
 I '$P(^ACRALC(ACRZDA,"DT"),U,9) D  Q
 .W !!,"No CAN has been specified for this allowance."
 .W !,"The CAN is required in order to create the DHR."
 .W !!,"Please enter the CAN before proceeding."
 .D PAUSE^ACRFWARN
 N ACRFEDC
 S ACRFEDC=2
 W !!,"A Document History Record (DHR) will now be created and forwarded"
 W !,"to the Health Accounting System."
 S DIR(0)="YO"
 S DIR("A")="Are you certain you want to proceed"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q:$G(Y)'=1
 D D1
 Q
D1 ;CREATE DHR
 K ACROBJ
 N ACROBJDA,ACRCANDA
 D ANUM
 Q:$D(ACRQUIT)
 Q:$L($G(ACRANUM))'=10
 S ACROBJ((ACRAPP_" "_$E(ACRFY,4)),ACRCANDA,ACROBJDA)=+^ACRALC(ACRZDA,0)
 S ACRREF=218
 S ACRTCODE=281
 S ACRRCODE=$S(+^ACRALC(ACRZDA,0)<0!($G(ACRORIG)="D"):2,1:1)
 S ACRMCODE=9
 S ACRDOC0=ACRANUM_U_ACRANUM
 S (ACRREF,ACRREFX)="043"
 D DHR^ACRFDHR
 Q:'$G(ACRDA)
 S DA=ACRZDA
 S DIE="^ACRALC("
 S DR=".19////"_ACRDA
 D DIE^ACRFDIC
DHRP ;EP;TO PRINT ALLOWANCE DHR
 Q:'$G(ACRDA)
 N ACRDOCDA
 S D0=ACRDA
 S (ACRRTN,ZTRTN)="P1^ACRFDHR"
 S ZTDESC="PRINT ALLOWANCE DHR"
 D ^ACRFZIS
 Q
ANUM ;CREATE ADVICE OF ALLOWANCE NUMBER
 N ACRFY,ACRFYY,X,Y,Z,ACRACPDA
 S X=^ACRALC(ACRZDA,"DT")
 S ACRAPPDA=$P(X,U,4)
 S ACRCANDA=$P(X,U,9)
 S ACRACPDA=$P(X,U,13)
 S ACROBJDA=$O(^AUTTOBJC("C","8116",0))
 S ACRAPP=$P($G(^AUTTPRO(+ACRAPPDA,0)),U)
 S (ACRFY,X)=$P(X,U)
 I ACRFY=""!'ACRACPDA S ACRQUIT="" Q
 I '$D(^ACRSYS(1,30,"B",ACRFY)) D  I 1
 .S DA(1)=1
 .S:'$D(^ACRSYS(1,30,0)) ^ACRSYS(1,30,0)="^9002199.231"
 .S DIC="^ACRSYS(1,30,"
 .S DIC(0)="L"
 .D FILE^ACRFDIC
 S ACRFYY=$O(^ACRSYS(1,30,"B",ACRFY,0))
 I 'ACRFYY S ACRQUIT="" Q
 I '$D(^ACRSYS(1,30,ACRFYY,1,ACRACPDA)) D
 .S (X,DINUM)=ACRACPDA
 .S DA(1)=1
 .S DA(2)=ACRFYY
 .S:'$D(^ACRSYS(1,30,ACRFYY,1,0)) ^ACRSYS(1,30,ACRFYY,1,0)="^9002199.2311"
 .S DIC="^ACRSYS(1,30,"_ACRFYY_",1,"
 .S DIC(0)="L"
 .D FILE^ACRFDIC
ANUM1 L ^ACRSYS(1,30,ACRFYY):2
 I $T D  I 1
 .S X=$P(^ACRSYS(1,30,ACRFYY,1,ACRACPDA,0),U,2)
 .S X=X+1
 .S $P(^ACRSYS(1,30,ACRFYY,1,ACRACPDA,0),U,2)=X
 .L -^ACRSYS(1,30,ACRFYY):0
 .S ACRANUM=X
 E  S ACRQUIT="" Q
 S ACRANUM=$E("00000",1,5-$L(ACRANUM))_ACRANUM
 S ACRACPT=$P(^AUTTACPT(ACRACPDA,0),U)
 S ACRANUM=$E(ACRFY,4)_"AL"_ACRACPT_ACRANUM
 I $D(^ACRALC("D",ACRANUM)) G ANUM1
 Q
OBLSTAT ;CHECK OBLIGATION STATUS
 K ACRQUIT
 N ACRX
 S ACRX=0
 F  S ACRX=$O(^ACRDHR("E",ACRDOCDA,ACRX)) Q:'ACRX  D
 .I $P($G(^ACRDHR(ACRX,1)),U,3,4)="050^1" W !!,"The obligation of funds for this document has been sent to HAS." S ACRQUIT=""
 .I $P($G(^ACRDHR(ACRX,1)),U,3,4)="050^2" W !,"But it appears that a de-obligation of funds has also been made." K ACRQUIT
 I $D(ACRQUIT) D
 .W !!,"This document must be CANCELLED before it can be re-sent to initiator."
 .D PAUSE^ACRFWARN
 .S ACRQUIT=""
 Q