DIOC ;SFISC/TKW-GENERATE CODE TO CHECK QUERY CONDITIONS ;04:18 PM 13 Feb 2002
;;22.2;VA FileMan;;Jan 05, 2016;Build 42
;;Per VA Directive 6402, this routine should not be modified.
;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
;;Licensed under the terms of the Apache License, Version 2.0.
;
BEF(X,Y,N,M) ; BEFORE (X before Y)
N Z D Q(.Y)
I $G(N)="'" S Z=Y_"']]"_X Q Z
S Z="" S:$G(M)]"" Z=X_"]"""","
S Z=Z_Y_"]]"_X Q Z
AFT(X,Y,N,M) ; AFTER (X after Y)
N Z D Q(.Y)
I $G(N)="'" S Z="" S:$G(M)]"" Z=X_"]""""," S Z=Z_X_"']]"_Y Q Z
S Z=X_"]]"_Y Q Z
BTWI(X,F,T,N,S) ;BETWEEN INCLUSIVE (NOTE: Param.'S' defined only if called from sort.
S S=$G(S) N Z
I $G(N)="'" S Z="("_$$BEF(X,F)_")!("_$$AFT(X,T)_")" Q Z
S:S]"" Z=$$AFT(X,F)
I S="" D Q(.F) S Z=F_"']]"_X
S Z="("_Z_")&("_$$AFT(X,T,"'")_")" Q Z
BTWE(X,F,T,N) ;BETWEEN EXCLUSIVE
N Z D Q(.T)
I $G(N)="'" S Z="("_$$AFT(X,F,"'")_")!("_T_"']]"_X_")" Q Z
S Z="("_$$AFT(X,F)_")&("_T_"]]"_X_")" Q Z
EQ(X,Y,N) ;EQUALS
N Z S:$G(N)'="'" N="" D Q(.Y) S Z=X_N_"="_Y Q Z
NULL(X,N) ;NULL
N Z S:$G(N)'="'" N="" S Z=X_N_"=""""" Q Z
;
Q(X) ;
I +$P(X,"E")'=X S X=""""_$$CONVQQ^DILIBF(X)_""""
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDIOC 1265 printed Oct 16, 2024@18:53:02 Page 2
DIOC ;SFISC/TKW-GENERATE CODE TO CHECK QUERY CONDITIONS ;04:18 PM 13 Feb 2002
+1 ;;22.2;VA FileMan;;Jan 05, 2016;Build 42
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
+4 ;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
+5 ;;Licensed under the terms of the Apache License, Version 2.0.
+6 ;
BEF(X,Y,N,M) ; BEFORE (X before Y)
+1 NEW Z
DO Q(.Y)
+2 IF $GET(N)="'"
SET Z=Y_"']]"_X
QUIT Z
+3 SET Z=""
if $GET(M)]""
SET Z=X_"]"""","
+4 SET Z=Z_Y_"]]"_X
QUIT Z
AFT(X,Y,N,M) ; AFTER (X after Y)
+1 NEW Z
DO Q(.Y)
+2 IF $GET(N)="'"
SET Z=""
if $GET(M)]""
SET Z=X_"]"""","
SET Z=Z_X_"']]"_Y
QUIT Z
+3 SET Z=X_"]]"_Y
QUIT Z
BTWI(X,F,T,N,S) ;BETWEEN INCLUSIVE (NOTE: Param.'S' defined only if called from sort.
+1 SET S=$GET(S)
NEW Z
+2 IF $GET(N)="'"
SET Z="("_$$BEF(X,F)_")!("_$$AFT(X,T)_")"
QUIT Z
+3 if S]""
SET Z=$$AFT(X,F)
+4 IF S=""
DO Q(.F)
SET Z=F_"']]"_X
+5 SET Z="("_Z_")&("_$$AFT(X,T,"'")_")"
QUIT Z
BTWE(X,F,T,N) ;BETWEEN EXCLUSIVE
+1 NEW Z
DO Q(.T)
+2 IF $GET(N)="'"
SET Z="("_$$AFT(X,F,"'")_")!("_T_"']]"_X_")"
QUIT Z
+3 SET Z="("_$$AFT(X,F)_")&("_T_"]]"_X_")"
QUIT Z
EQ(X,Y,N) ;EQUALS
+1 NEW Z
if $GET(N)'="'"
SET N=""
DO Q(.Y)
SET Z=X_N_"="_Y
QUIT Z
NULL(X,N) ;NULL
+1 NEW Z
if $GET(N)'="'"
SET N=""
SET Z=X_N_"="""""
QUIT Z
+2 ;
Q(X) ;
+1 IF +$PIECE(X,"E")'=X
SET X=""""_$$CONVQQ^DILIBF(X)_""""
+2 QUIT