AMERBEDD ;GDIT/HS/BEE - AMER UTILITY CALLS ; 07 Oct 2013 11:33 AM
;;3.0;ER VISIT SYSTEM;**6**;MAR 03, 2009;Build 30
;
Q
;
INJ(FIELD,VALUE) ;Update BEDD injury field if BEDD is installed
;
;Quit if BEDD 2.0 not installed
I $T(INJFLD^BEDDINJ)="" Q
I $G(FIELD)="" Q
I $G(VALUE)="" Q
;
NEW VIEN
;
;Look for VIEN
S VIEN=$G(^TMP("AMER",$J,4))
;
;If no VIEN, try getting from DFN
I VIEN="" D Q:VIEN=""
. NEW DFN
. S DFN=$G(^TMP("AMER",$J,1,1)) Q:DFN=""
. S VIEN=$$GET1^DIQ(9009081,DFN_",",1.1,"I")
;
;Make the call to BEDD
D INJFLD^BEDDINJ(VIEN,FIELD,VALUE)
;
Q
AMERBEDD ;GDIT/HS/BEE - AMER UTILITY CALLS ; 07 Oct 2013 11:33 AM
+1 ;;3.0;ER VISIT SYSTEM;**6**;MAR 03, 2009;Build 30
+2 ;
+3 QUIT
+4 ;
INJ(FIELD,VALUE) ;Update BEDD injury field if BEDD is installed
+1 ;
+2 ;Quit if BEDD 2.0 not installed
+3 IF $TEXT(INJFLD^BEDDINJ)=""
QUIT
+4 IF $GET(FIELD)=""
QUIT
+5 IF $GET(VALUE)=""
QUIT
+6 ;
+7 NEW VIEN
+8 ;
+9 ;Look for VIEN
+10 SET VIEN=$GET(^TMP("AMER",$JOB,4))
+11 ;
+12 ;If no VIEN, try getting from DFN
+13 IF VIEN=""
Begin DoDot:1
+14 NEW DFN
+15 SET DFN=$GET(^TMP("AMER",$JOB,1,1))
IF DFN=""
QUIT
+16 SET VIEN=$$GET1^DIQ(9009081,DFN_",",1.1,"I")
End DoDot:1
IF VIEN=""
QUIT
+17 ;
+18 ;Make the call to BEDD
+19 DO INJFLD^BEDDINJ(VIEN,FIELD,VALUE)
+20 ;
+21 QUIT