BMXG ; IHS/OIT/HMW - UTIL: GET DATA ;
;;4.0;BMX;;JUN 28, 2010
;;Stolen from:* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
;
;
;----------
GET(FILE,Y,PC) ;EP
;---> Return text of .01 Field of an entry in a file.
;---> Parameters:
; 1 - FILE (req) Number corresponding to desired file:
; 1 = State File, #5
; 2 = Community File, #9999999.5
; 3 = Employer File, #9999999.75
; 4 = Beneficiary File, #9999999.25
; 5 = Tribe File, #9999999.03
; 6 = Insurer File, #9999999.18
; 7 = Suffix File, #9999999.32
; 8 = Employer Group Insurance File, #9999999.77
; 9 = Medicare Eligible File, #9000003
; 10 = Medicaid Eligible File, #9000004
; 11 = Private Insurance Eligible File, #9000006
; 12 = Patient File, #9000001
; 13 = VA Patient File, #2
; 14 = Policy Holder File, #9000003.1
; 15 = Relationship File, #9999999.36
;
; 2 - Y (req) IEN in the File storing the desired entry.
; 3 - PC (opt) Piece of 0-Node to return (default=1).
; If PC=0 return entire 0-node.
;
Q:($G(Y)'?1N.N) ""
Q:'$G(FILE) ""
S:$G(PC)="" PC=1 S U="^"
;
D
.I FILE=1 S GLB="^DIC(5,"_Y_",0)" Q
.I FILE=2 S GLB="^AUTTCOM("_Y_",0)" Q
.I FILE=3 S GLB="^AUTNEMPL("_Y_",0)" Q
.I FILE=4 S GLB="^AUTTBEN("_Y_",0)" Q
.I FILE=5 S GLB="^AUTTTRI("_Y_",0)" Q
.I FILE=6 S GLB="^AUTNINS("_Y_",0)" Q
.I FILE=7 S GLB="^AUTTMCS("_Y_",0)" Q
.I FILE=8 S GLB="^AUTNEGRP("_Y_",0)" Q
.I FILE=9 S GLB="^AUPNMCR("_Y_",0)" Q
.I FILE=10 S GLB="^AUPNMCD("_Y_",0)" Q
.I FILE=11 S GLB="^AUPNPRVT("_Y_",0)" Q
.I FILE=12 S GLB="^AUPNPAT("_Y_",0)" Q
.I FILE=13 S GLB="^DPT("_Y_",0)" Q
.I FILE=14 S GLB="^AUPN3PPH("_Y_",0)" Q
.I FILE=15 S GLB="^AUTTRLSH("_Y_",0)" Q
;
Q:'FILE ""
Q:PC=0 $G(@GLB)
Q $P($G(@GLB),U,PC)
BMXG ; IHS/OIT/HMW - UTIL: GET DATA ;
+1 ;;4.0;BMX;;JUN 28, 2010
+2 ;;Stolen from:* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
+3 ;
+4 ;
+5 ;----------
GET(FILE,Y,PC) ;EP
+1 ;---> Return text of .01 Field of an entry in a file.
+2 ;---> Parameters:
+3 ; 1 - FILE (req) Number corresponding to desired file:
+4 ; 1 = State File, #5
+5 ; 2 = Community File, #9999999.5
+6 ; 3 = Employer File, #9999999.75
+7 ; 4 = Beneficiary File, #9999999.25
+8 ; 5 = Tribe File, #9999999.03
+9 ; 6 = Insurer File, #9999999.18
+10 ; 7 = Suffix File, #9999999.32
+11 ; 8 = Employer Group Insurance File, #9999999.77
+12 ; 9 = Medicare Eligible File, #9000003
+13 ; 10 = Medicaid Eligible File, #9000004
+14 ; 11 = Private Insurance Eligible File, #9000006
+15 ; 12 = Patient File, #9000001
+16 ; 13 = VA Patient File, #2
+17 ; 14 = Policy Holder File, #9000003.1
+18 ; 15 = Relationship File, #9999999.36
+19 ;
+20 ; 2 - Y (req) IEN in the File storing the desired entry.
+21 ; 3 - PC (opt) Piece of 0-Node to return (default=1).
+22 ; If PC=0 return entire 0-node.
+23 ;
+24 IF ($GET(Y)'?1N.N)
QUIT ""
+25 IF '$GET(FILE)
QUIT ""
+26 IF $GET(PC)=""
SET PC=1
SET U="^"
+27 ;
+28 Begin DoDot:1
+29 IF FILE=1
SET GLB="^DIC(5,"_Y_",0)"
QUIT
+30 IF FILE=2
SET GLB="^AUTTCOM("_Y_",0)"
QUIT
+31 IF FILE=3
SET GLB="^AUTNEMPL("_Y_",0)"
QUIT
+32 IF FILE=4
SET GLB="^AUTTBEN("_Y_",0)"
QUIT
+33 IF FILE=5
SET GLB="^AUTTTRI("_Y_",0)"
QUIT
+34 IF FILE=6
SET GLB="^AUTNINS("_Y_",0)"
QUIT
+35 IF FILE=7
SET GLB="^AUTTMCS("_Y_",0)"
QUIT
+36 IF FILE=8
SET GLB="^AUTNEGRP("_Y_",0)"
QUIT
+37 IF FILE=9
SET GLB="^AUPNMCR("_Y_",0)"
QUIT
+38 IF FILE=10
SET GLB="^AUPNMCD("_Y_",0)"
QUIT
+39 IF FILE=11
SET GLB="^AUPNPRVT("_Y_",0)"
QUIT
+40 IF FILE=12
SET GLB="^AUPNPAT("_Y_",0)"
QUIT
+41 IF FILE=13
SET GLB="^DPT("_Y_",0)"
QUIT
+42 IF FILE=14
SET GLB="^AUPN3PPH("_Y_",0)"
QUIT
+43 IF FILE=15
SET GLB="^AUTTRLSH("_Y_",0)"
QUIT
End DoDot:1
+44 ;
+45 IF 'FILE
QUIT ""
+46 IF PC=0
QUIT $GET(@GLB)
+47 QUIT $PIECE($GET(@GLB),U,PC)