BGOVELD ; IHS/BAO/TMD - Manage V Elder Care ;09-Apr-2012 14:18;DU
;;1.1;BGO COMPONENTS;**1,3,11**;Mar 20, 2007;Build 3
; Get elder care entries by individual entry, visit, or patient
; INP = Patient IEN [1] ^ V File IEN [2] ^ Visit IEN [3]
GET(RET,INP) ;EP
D VFGET^BGOUTL2(.RET,INP,$$FNUM,".03;.04;.05;.06;.07;.08;.09;.11;.12;.13;.14;.15;.16;.17;.18;1201;1204")
Q
; Add/edit V Elder Care entry
; INP = V File IEN [1] ^ Visit IEN [2] ^ Toileting [3] ^ Bathing [4] ^
; Dressing [5] ^ Transfers [6] ^ Feeding [7] ^ Continence [8] ^
; Finances [9] ^ Cooking [10] ^ Shopping [11] ^ Chores [12] ^
; Medications [13] ^ Transporation [14] ^ Func Status Change [15] ^
; Caregiver [16]
SET(RET,INP) ;EP
N VIEN,VFIEN,VFNEW,FNUM
S RET="",FNUM=$$FNUM
S VFIEN=+INP
S VFNEW='VFIEN
S VIEN=$P(INP,U,2)
S RET=$$CHKVISIT^BGOUTL(VIEN)
Q:RET
I 'VFIEN D Q:'VFIEN
.D VFNEW^BGOUTL2(.RET,FNUM,"IHS-1-865",VIEN)
.S:RET>0 VFIEN=RET,RET=""
S FDA=$NA(FDA(FNUM,VFIEN_","))
S @FDA@(.04)=$P(INP,U,3)
S @FDA@(.05)=$P(INP,U,4)
S @FDA@(.06)=$P(INP,U,5)
S @FDA@(.07)=$P(INP,U,6)
S @FDA@(.08)=$P(INP,U,7)
S @FDA@(.09)=$P(INP,U,8)
S @FDA@(.11)=$P(INP,U,9)
S @FDA@(.12)=$P(INP,U,10)
S @FDA@(.13)=$P(INP,U,11)
S @FDA@(.14)=$P(INP,U,12)
S @FDA@(.15)=$P(INP,U,13)
S @FDA@(.16)=$P(INP,U,14)
S @FDA@(.17)=$P(INP,U,15)
S @FDA@(.18)=$P(INP,U,16)
S @FDA@(1201)="N"
S @FDA@(1204)="`"_DUZ
;Patch 11 Set date entered
I VFNEW D
.S @FDA@(1216)="N"
.S @FDA@(1217)="`"_DUZ
;Patch 11 Set last modified
S @FDA@(1218)="N"
S @FDA@(1219)="`"_DUZ
S RET=$$UPDATE^BGOUTL(.FDA,"E")
I RET,VFNEW,$$DELETE^BGOUTL(FNUM,VFIEN)
D:'RET VFEVT^BGOUTL2(FNUM,VFIEN,'VFNEW)
S:'RET RET=VFIEN
Q
; Delete an Elder Care entry
DEL(RET,VFIEN) ;EP
D VFDEL^BGOUTL2(.RET,$$FNUM,VFIEN)
Q
; Return V File #
FNUM() Q 9000010.35
BGOVELD ; IHS/BAO/TMD - Manage V Elder Care ;09-Apr-2012 14:18;DU
+1 ;;1.1;BGO COMPONENTS;**1,3,11**;Mar 20, 2007;Build 3
+2 ; Get elder care entries by individual entry, visit, or patient
+3 ; INP = Patient IEN [1] ^ V File IEN [2] ^ Visit IEN [3]
GET(RET,INP) ;EP
+1 DO VFGET^BGOUTL2(.RET,INP,$$FNUM,".03;.04;.05;.06;.07;.08;.09;.11;.12;.13;.14;.15;.16;.17;.18;1201;1204")
+2 QUIT
+3 ; Add/edit V Elder Care entry
+4 ; INP = V File IEN [1] ^ Visit IEN [2] ^ Toileting [3] ^ Bathing [4] ^
+5 ; Dressing [5] ^ Transfers [6] ^ Feeding [7] ^ Continence [8] ^
+6 ; Finances [9] ^ Cooking [10] ^ Shopping [11] ^ Chores [12] ^
+7 ; Medications [13] ^ Transporation [14] ^ Func Status Change [15] ^
+8 ; Caregiver [16]
SET(RET,INP) ;EP
+1 NEW VIEN,VFIEN,VFNEW,FNUM
+2 SET RET=""
SET FNUM=$$FNUM
+3 SET VFIEN=+INP
+4 SET VFNEW='VFIEN
+5 SET VIEN=$PIECE(INP,U,2)
+6 SET RET=$$CHKVISIT^BGOUTL(VIEN)
+7 IF RET
QUIT
+8 IF 'VFIEN
Begin DoDot:1
+9 DO VFNEW^BGOUTL2(.RET,FNUM,"IHS-1-865",VIEN)
+10 IF RET>0
SET VFIEN=RET
SET RET=""
End DoDot:1
IF 'VFIEN
QUIT
+11 SET FDA=$NAME(FDA(FNUM,VFIEN_","))
+12 SET @FDA@(.04)=$PIECE(INP,U,3)
+13 SET @FDA@(.05)=$PIECE(INP,U,4)
+14 SET @FDA@(.06)=$PIECE(INP,U,5)
+15 SET @FDA@(.07)=$PIECE(INP,U,6)
+16 SET @FDA@(.08)=$PIECE(INP,U,7)
+17 SET @FDA@(.09)=$PIECE(INP,U,8)
+18 SET @FDA@(.11)=$PIECE(INP,U,9)
+19 SET @FDA@(.12)=$PIECE(INP,U,10)
+20 SET @FDA@(.13)=$PIECE(INP,U,11)
+21 SET @FDA@(.14)=$PIECE(INP,U,12)
+22 SET @FDA@(.15)=$PIECE(INP,U,13)
+23 SET @FDA@(.16)=$PIECE(INP,U,14)
+24 SET @FDA@(.17)=$PIECE(INP,U,15)
+25 SET @FDA@(.18)=$PIECE(INP,U,16)
+26 SET @FDA@(1201)="N"
+27 SET @FDA@(1204)="`"_DUZ
+28 ;Patch 11 Set date entered
+29 IF VFNEW
Begin DoDot:1
+30 SET @FDA@(1216)="N"
+31 SET @FDA@(1217)="`"_DUZ
End DoDot:1
+32 ;Patch 11 Set last modified
+33 SET @FDA@(1218)="N"
+34 SET @FDA@(1219)="`"_DUZ
+35 SET RET=$$UPDATE^BGOUTL(.FDA,"E")
+36 IF RET
IF VFNEW
IF $$DELETE^BGOUTL(FNUM,VFIEN)
+37 IF 'RET
DO VFEVT^BGOUTL2(FNUM,VFIEN,'VFNEW)
+38 IF 'RET
SET RET=VFIEN
+39 QUIT
+40 ; Delete an Elder Care entry
DEL(RET,VFIEN) ;EP
+1 DO VFDEL^BGOUTL2(.RET,$$FNUM,VFIEN)
+2 QUIT
+3 ; Return V File #
FNUM() QUIT 9000010.35