PRCN11PO ;WISC/CW-post init patch 11 ;08-Nov-02
;;1.0;Equipment/Turn-In Request;**11**;Sep 13, 1996
Q
POST ;start post init
;add line item count to file 410 if record contains line items
;
N U,PRCNUM,PRCNIMP,PRCNLIC,PRCNFND,PRCNDA1,PRCNDA2
D BMES^XPDUTL(" >> Starting the Post-Initialization routine ...")
D MES^XPDUTL(" -> Adding LINE ITEM COUNT to file 410 ...")
;
S U="^",(PRCNDA1,PRCNFND,PRCNUM)=0
F S PRCNDA1=$O(^PRCN(413,PRCNDA1)) Q:'PRCNDA1 D
. S PRCNIMP=$P($G(^PRCN(413,PRCNDA1,0)),U,7)
. ;request status in file 413.5 ;19-Approved-Funded
. ;39-Ready for 2237 Processing ;18-Approved-Pending Funding
. I (PRCNIMP'=39),(PRCNIMP'=18),(PRCNIMP'=19) Q
. S PRCNIMP=$P(^PRCN(413,PRCNDA1,0),U)
. S PRCNDA2=$O(^PRCS(410,"H",PRCNIMP,""))
. Q:PRCNDA2=""
. Q:'$D(^PRCS(410,PRCNDA2,"IT",1))
. Q:'$D(^PRCS(410,PRCNDA2,10))
. Q:$P(^PRCS(410,PRCNDA2,10),U)
. S PRCNFND=1
. S PRCNLIC=$O(^PRCS(410,PRCNDA2,"IT",99),-1),PRCNUM=PRCNUM+1
. S ^PRCS(410,PRCNDA2,10)=PRCNLIC_U_$P(^PRCS(410,PRCNDA2,10),U,2,99)
. W !!,PRCNUM_". "_"LINE ITEM COUNT "_PRCNLIC_" has been added to the entry record "_PRCNDA2_".",!
;
I 'PRCNFND D MES^XPDUTL(" No records need to be updated!")
D MES^XPDUTL(" >> End of the Post-Initialization routine ...")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCN11PO 1299 printed Dec 13, 2024@01:54:09 Page 2
PRCN11PO ;WISC/CW-post init patch 11 ;08-Nov-02
+1 ;;1.0;Equipment/Turn-In Request;**11**;Sep 13, 1996
+2 QUIT
POST ;start post init
+1 ;add line item count to file 410 if record contains line items
+2 ;
+3 NEW U,PRCNUM,PRCNIMP,PRCNLIC,PRCNFND,PRCNDA1,PRCNDA2
+4 DO BMES^XPDUTL(" >> Starting the Post-Initialization routine ...")
+5 DO MES^XPDUTL(" -> Adding LINE ITEM COUNT to file 410 ...")
+6 ;
+7 SET U="^"
SET (PRCNDA1,PRCNFND,PRCNUM)=0
+8 FOR
SET PRCNDA1=$ORDER(^PRCN(413,PRCNDA1))
if 'PRCNDA1
QUIT
Begin DoDot:1
+9 SET PRCNIMP=$PIECE($GET(^PRCN(413,PRCNDA1,0)),U,7)
+10 ;request status in file 413.5 ;19-Approved-Funded
+11 ;39-Ready for 2237 Processing ;18-Approved-Pending Funding
+12 IF (PRCNIMP'=39)
IF (PRCNIMP'=18)
IF (PRCNIMP'=19)
QUIT
+13 SET PRCNIMP=$PIECE(^PRCN(413,PRCNDA1,0),U)
+14 SET PRCNDA2=$ORDER(^PRCS(410,"H",PRCNIMP,""))
+15 if PRCNDA2=""
QUIT
+16 if '$DATA(^PRCS(410,PRCNDA2,"IT",1))
QUIT
+17 if '$DATA(^PRCS(410,PRCNDA2,10))
QUIT
+18 if $PIECE(^PRCS(410,PRCNDA2,10),U)
QUIT
+19 SET PRCNFND=1
+20 SET PRCNLIC=$ORDER(^PRCS(410,PRCNDA2,"IT",99),-1)
SET PRCNUM=PRCNUM+1
+21 SET ^PRCS(410,PRCNDA2,10)=PRCNLIC_U_$PIECE(^PRCS(410,PRCNDA2,10),U,2,99)
+22 WRITE !!,PRCNUM_". "_"LINE ITEM COUNT "_PRCNLIC_" has been added to the entry record "_PRCNDA2_".",!
End DoDot:1
+23 ;
+24 IF 'PRCNFND
DO MES^XPDUTL(" No records need to be updated!")
+25 DO MES^XPDUTL(" >> End of the Post-Initialization routine ...")
+26 QUIT