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

DG1010P0.m

Go to the documentation of this file.
  1. DG1010P0 ;ALB/REW - VA FORM 10-10 UTILITIES ;29 MAY 92
  1. ;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
  1. UNK(X,NA,BL) ;Returns a value depending on the FIRST true condition:
  1. ; NA = 1 : 'NOT APPLICABLE'
  1. ; X NOT NULL: X
  1. ; BL = 1 : NULL VALUE
  1. ; ELSE : 'UNANSWERED'
  1. ; INPUT -- X Any value
  1. ; NA,BL (Optional) [See above]
  1. ; OUTPUT -- [Returned]
  1. ; OUTPUT[Set] -- DGUNK =1 if NA=1 or X=""
  1. S DGUNK=$S($G(NA):1,(X]""):0,1:1)
  1. Q $S(($G(NA)):"NOT APPLICABLE",(X]""):X,($G(BL)):"",1:"UNANSWERED")
  1. DISP(N,P,NA,BL) ;
  1. ; Returns the Pth '^' piece of 'N'
  1. ; Output is modified by NA & BL as per $$UNK[see above]
  1. ; INPUT: N -- Contents of a node
  1. ; P -- the Pth '^' piece
  1. ; NA,BL -- Optional output modifiers
  1. ; OUTPUT[Returned] -- X
  1. ; OUTPUT[Set] -- DGUNK =1 if NA=1 or X=""
  1. NEW X
  1. S X=$P($G(N),"^",P)
  1. S DGUNK=$S($G(NA):1,(X]""):0,1:1)
  1. Q $S(($G(NA)):"NOT APPLICABLE",(X]""):X,($G(BL)):"",1:"UNANSWERED")
  1. POINT(N,P,ROOT,P2,NA,BL) ;
  1. ; Returns the external value of a pointer.
  1. ; Output is modified by NA & BL as per $$UNK[see above]
  1. ; INPUT:
  1. ; N -- Contents of a node
  1. ; P -- the Pth '^' piece that holds the pointer
  1. ; ROOT -- The global root or filenumber if root is ^DIC(ROOT,
  1. ; P2 -- The piece of the pointed-to file [Default=1]
  1. ; NA,BL-- Optional output modifiers
  1. ; OUTPUT[Returned] -- X
  1. ; OUTPUT[Set] -- DGUNK =1 if NA=1 or (X or N)=""
  1. NEW X,F
  1. ; F -- VALUE OF FIELD
  1. S:('$G(P2)) P2=1
  1. S F=$P(N,"^",P)
  1. S:+ROOT X=$P($G(^DIC(ROOT,+F,0)),U,P2)
  1. S:(+ROOT=0) X=$P($G(@(ROOT_+F_",0)")),U,P2)
  1. S DGUNK=$S($G(NA):1,(X]""):0,1:1)
  1. Q $S(($G(NA)):"NOT APPLICABLE",(X]""):X,(F]""):"INVALID",($G(BL)):"",1:"UNANSWERED")
  1. DATENP(N,P,NA,BL) ;
  1. ; Returns External Value of Date in the Pth '^' piece of 'N'
  1. ; Output is modified by NA & BL as per $$UNK[see above]
  1. ; INPUT:
  1. ; N -- Contents of a node
  1. ; P -- the Pth '^' piece
  1. ; NA,BL -- Optional output modifiers
  1. ; OUTPUT[Returned] -- X
  1. ; OUTPUT[Set] -- DGUNK =1 if NA=1 or X=""
  1. N Y
  1. S Y=$$DISP(N,P,+$G(NA),$G(BL))
  1. I DGUNK G QDNP
  1. X ^DD("DD")
  1. QDNP ;
  1. Q Y
  1. YN2(N,P) ;
  1. ; Ext Val of YES/NO given node & piece.
  1. ;IN: N -- Val of Node
  1. ; P -- Piece
  1. ;OUT:[RETURN] -- Ext Val
  1. S X=$P(N,"^",P)
  1. Q $S((X="Y"):"YES",(X="N"):"NO",(X="U"):"UNKNOWN",(X=""):"UNANSWERED",("0"[X):"NO",("12"[X):"YES",("3"[X):"UNKNOWN",1:"INVALID")