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

DMSQT1.m

Go to the documentation of this file.
  1. DMSQT1 ;SFISC/EZ-STATUS CHECK ;11/13/97 12:08
  1. ;;22.2;VA FileMan;;Jan 05, 2016;Build 42
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
  1. ;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
  1. ;;Licensed under the terms of the Apache License, Version 2.0.
  1. ;
  1. Q
  1. WAIT() ; extrinsic function, checks if SQLI is running (you must wait)
  1. ; returns 1 if nodes in ^DMSQ are changing, null otherwise
  1. D DT^DICRW N J,FLG,DM S FLG=""
  1. D SET H 2 D CHK
  1. I FLG Q 1
  1. E Q ""
  1. SET ; set the DM array with current record counts
  1. S J=""
  1. F S J=$O(^DMSQ(J)) Q:J="" S DM(J)=$P(^(J,0),U,3)
  1. Q
  1. CHK ; check whether the counts have changed
  1. S J=""
  1. F S J=$O(^DMSQ(J)) Q:J="" S:DM(J)'=$P(^(J,0),U,3) FLG=1
  1. Q
  1. IDX(TI) ; extrinsic function, checks for indexes on table TI
  1. ; returns 1 if there are more indexes to process
  1. ; see INDEX^DMSQF2 for similar index checking code
  1. N F,FI,IN,I,IF,IX,CI,FLG D DT^DICRW S FLG=""
  1. S F=$P(^DMSQ("T",TI,0),U,7)
  1. S FI=0 F S FI=$O(^DD(F,FI)) Q:'FI D
  1. . S IN=0 F S IN=$O(^DD(F,FI,1,IN)) Q:'IN D
  1. .. S I=$G(^DD(F,FI,1,IN,0))
  1. .. I $P(I,U,3)]"" Q ; not a regular index
  1. .. I I="" Q ; no data at DD location
  1. .. S IF=+I,IX=$P(I,U,2) I IX=""!'IF Q ; no file # or index name
  1. .. I $G(^DD(F,FI,1,IN,1))'[",DA)" Q ; last subscript isn't DA
  1. .. S CI=$O(^DMSQ("C","D",F,FI,"")) Q:'CI ; missing column
  1. .. S FLG=2 ; this index is a candidate for projection
  1. I FLG=2 Q 1
  1. E Q ""