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

PRC0D.m

Go to the documentation of this file.
  1. PRC0D ;WISC/PLT-IFCAP UTILITY ; 04/14/94 1:21 PM
  1. V ;;5.1;IFCAP;;Oct 20, 2000
  1. ;Per VHA Directive 10-93-142, this routine should not be modified.
  1. QUIT ;invalid entry
  1. ;
  1. ;A=station #,B=acc^prc0c string
  1. FMSACC(A,B) ;EF - value=field .01 of rile 420.141
  1. ;~1=station 3, ~2=bbbfy, ~3=fund code, ~4=a/o, ~5=program,
  1. ;~6=fcp/prj, ~7=object clas, ~8=job #
  1. N C
  1. S C=A,$P(C,"~",2)=$P(B,"^",6),$P(C,"~",3)=$P(B,"^",5)
  1. S $P(C,"~",4)=$P(B,"^"),$P(C,"~",5)=$P(B,"^",2),$P(C,"~",6)=$P(B,"^",3)
  1. S $P(C,"~",7)=$P(B,"^",4),$P(C,"~",8)=$P(B,"^",10)
  1. QUIT C
  1. ;
  1. ;A=station, B=fcp#, C=fy, D=1 if obligate balance, 2 if comm, 3 if scp comm
  1. ;return value data ^1=1st qtr bal, ^2=2nd, ^3=3rd, ^4=4th
  1. FCPBAL(A,B,C,D) ;EF get fcp balance
  1. S A=$G(^PRC(420,+A,1,+B,4,C,$S(D=3:1,1:0)))
  1. Q $S(D=1:$P(A,"^",6,9),1:$P(A,"^",2,5))
  1. ;
  1. ;A=station, B=fcp#
  1. ;return value 1=gpf, 2=supp, 3=casca/canteen
  1. SFCP(A,B) ;EF get special control point code
  1. Q $P($G(^PRC(420,+A,1,+B,0)),"^",12)
  1. ;
  1. ;A is data, ^1=nil,^2=station #,^3=fcp#,^4=fy,^5=bbfy
  1. FCPVAL(A) ;EF validate fcp, EF value=1 if invalid
  1. N PRCA,PRCB,B,C,Z
  1. D DOCREQ^PRC0C(A,"AB","PRCA"),DOCREQ^PRC0C(A,"SAB","PRCB")
  1. S Z=""
  1. S:'$P(PRCA,"^",9)!'$P(PRCA,"^",6) Z=1
  1. I 'Z F B=1:1:4 S C=$P("AO^PGM^FCPRJ^OC","^",B) S:$G(PRCA(C))="Y"!($G(PRCB(C))="Y")&($P(PRCA,"^",B)="")!($G(PRCA(C))="N"&($G(PRCB(C))="N")&($P(PRCA,"^",B)]"")) Z=1 QUIT:Z
  1. D:'Z
  1. . S C="" F B="SPE","REV","GL" S C=C_$$REQ^PRC0C($P(PRCA,"^",9),B,"JOB")
  1. . I C["Y",$P(PRCA,"^",10)="" S Z=1
  1. . I 'Z I C'["Y",$P(PRCA,"^",10)]"" S Z=1
  1. . QUIT
  1. QUIT Z
  1. ;
  1. ;A=station #, B data=^1 fcp1, ^2 fy, ^3 bbfy, ^4 fcp2
  1. FCPTRF(A,B) ;EF compare fms accounts value =1 if allow transfer
  1. N C,D,Z
  1. S Z=""
  1. S C=$$ACC^PRC0C(A,$P(B,"^",1,3)),D=$$ACC^PRC0C(A,$P(B,"^",4)_"^"_$P(B,"^",2,3))
  1. S B=$P(C,"^",8),C=$$FMSACC(A,C),D=$$FMSACC(A,D)
  1. I $P(C,"~",1,5)=$P(D,"~",1,5) S Z=1
  1. E I B="Y",$P(C,"~",1,4)=$P(D,"~",1,4) S Z=1
  1. QUIT Z
  1. ;
  1. ;A=fy, B=quarter
  1. QTRDATE(A,B) ;EF value=$$DATE^PRC0C - the first date of the quarter
  1. S A=$$YEAR^PRC0C(A)-(B<2),B=$P("10~1~4~7","~",B)_"/1/"_A
  1. QUIT $$DATE^PRC0C(B,"E")
  1. ;
  1. ;A=station #, B=fcp#, C=1 if display available year
  1. BBFY(A,B,C) ;EF value ~1=0-node of file 420.14, ~2=fcp bbfy, ~3=length of fund, ~4=default year
  1. N D,E,F,G,H,I,J
  1. S D=$G(^PRC(420,+A,1,+B,5)) I D="" QUIT ""
  1. S E=+$$DATE^PRC0C($P(D,"^",8),"I")
  1. S F=$$FUND^PRC0C($P(D,"^",1),E) I F="" QUIT ""
  1. S $P(F,"~",2)=E,G=$P(F,"^",5)-$P(F,"^",4)+1,$P(F,"~",3)=G
  1. S J=+$$DATE^PRC0C($H,"H")
  1. I G<2 D:C EN^DDIOL("Warning: Selected Fund Control Point has a single year fund with multi-appropriation set up.")
  1. F I=J:-1:J-G+1 Q:I-E#G=0
  1. S E=I,I="" F H=-3*G+E:G:3*G+E S I=I_H_" " S:H'>J $P(F,"~",4)=H
  1. D:C EN^DDIOL("Enter a year in the following sequence of years.")
  1. D:C EN^DDIOL("..."_I_"...")
  1. QUIT F