source: FOIAVistA/trunk/r/VA_FILEMAN-ARJT-DI-DD-DM-DT-%DT-%RCR/DICLIB.m@ 1334

Last change on this file since 1334 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1018 bytes
Line 
1DICLIB ;SFISC/TKW - LIBRARY OF FUNCTIONS FOR ^DIC ;05:00 PM 14 Oct 1998
2 ;;22.0;VA FileMan;;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4NXTNO(F,DA,FLAGS) ;GET NEXT RECORD NUMBER FOR FILE OR SUBFILE F (F CAN CONTAIN A GLOBAL REFERENCE TO IMPROVE EFFICIENCY)
5 ;DA=DA ARRAY (IF F IS A SUBFILE)
6 ;FLAGS (OPTIONAL) IF IT CONTAINS "U", WILL UPDATE LAST REC.# ON 0 NODE
7 N I,X,Y,DIC,% S X=0,I=1
8 S:'F DIC=$TR(F,")",",") S:F DIC=$$ROOT^DIQGU(F,.DA)
9 G:DIC="" QI G:'$D(@(DIC_"0)")) QI
10INCR L @("+"_DIC_"0):10") G:'$T QL
11 I 'X S Y=@(DIC_"0)"),X=$P($P(Y,U,3),"."),%=+$P(Y,U,2) I '$D(^DIA(%,"B")) S %=0
12 F I=1:1 S X=X+1 Q:'$D(@(DIC_X_")"))&$S(%:+$O(^DIA(%,"B",X_","))'=X&'$D(^(X)),1:1) I I=100 S I=0 Q
13 I 'I L @("-"_DIC_"0)") G INCR
14 I $G(FLAGS)["U" S $P(@(DIC_"0)"),U,3,4)=X_U_($P(Y,U,4)+1)
15 L @("-"_DIC_"0)")
16 Q X
17QI D BLD^DIALOG(200) G Q0
18QL D BLD^DIALOG(110,F)
19Q0 Q 0
20 ;DIALOG #200 'An input variable or parameter is missing or invalid.'
21 ; #110 'The record is currently locked'
Note: See TracBrowser for help on using the repository browser.