USRM ; SLC/JER - User class membership library ;10/16/1998 11/16/09
;;1.0;AUTHORIZATION/SUBSCRIPTION;**3,10,33**;Jun 20, 1997;Build 5
UPDATE(ITEM) ; Updates list following edit
N USRDA,USRDUZ,USRSIGNM,USREFF,USREXP,USRMEM,USRREC,USRCLNM
S USRDA=$P(ITEM,U,2)
S USRMEM=$G(^USR(8930.3,+USRDA,0))
;If membership was removed, restore and quit.
I USRMEM="" D RESTORE^VALM10(+ITEM) Q
S USRDUZ=+USRMEM,USRSIGNM=$$SIGNAME^USRLS(+USRDUZ)
S USRCLNM=$$CLNAME^USRLM(+$P(USRMEM,U,2),1)
S USREFF=$$DATE^USRLS(+$P(USRMEM,U,3),"MM/DD/YY")
S USREXP=$$DATE^USRLS(+$P(USRMEM,U,4),"MM/DD/YY")
S USRREC=$$SETFLD^VALM1(+ITEM,"","NUMBER")
S USRREC=$$SETFLD^VALM1(USRSIGNM,USRREC,"MEMBER")
S USRREC=$$SETFLD^VALM1(USREFF,USRREC,"EFFECTIVE")
S USRREC=$$SETFLD^VALM1(USREXP,USRREC,"EXPIRES")
S USRREC=$$SETFLD^VALM1(USRCLNM,USRREC,"CLASS")
S ^TMP("USRMMBR",$J,+ITEM,0)=USRREC
D RESTORE^VALM10(+ITEM),CNTRL^VALM10(+ITEM,1,VALM("RM"),IOINHI,IOINORM)
Q
USRM ; SLC/JER - User class membership library ;10/16/1998 11/16/09
+1 ;;1.0;AUTHORIZATION/SUBSCRIPTION;**3,10,33**;Jun 20, 1997;Build 5
UPDATE(ITEM) ; Updates list following edit
+1 NEW USRDA,USRDUZ,USRSIGNM,USREFF,USREXP,USRMEM,USRREC,USRCLNM
+2 SET USRDA=$PIECE(ITEM,U,2)
+3 SET USRMEM=$GET(^USR(8930.3,+USRDA,0))
+4 ;If membership was removed, restore and quit.
+5 IF USRMEM=""
DO RESTORE^VALM10(+ITEM)
QUIT
+6 SET USRDUZ=+USRMEM
SET USRSIGNM=$$SIGNAME^USRLS(+USRDUZ)
+7 SET USRCLNM=$$CLNAME^USRLM(+$PIECE(USRMEM,U,2),1)
+8 SET USREFF=$$DATE^USRLS(+$PIECE(USRMEM,U,3),"MM/DD/YY")
+9 SET USREXP=$$DATE^USRLS(+$PIECE(USRMEM,U,4),"MM/DD/YY")
+10 SET USRREC=$$SETFLD^VALM1(+ITEM,"","NUMBER")
+11 SET USRREC=$$SETFLD^VALM1(USRSIGNM,USRREC,"MEMBER")
+12 SET USRREC=$$SETFLD^VALM1(USREFF,USRREC,"EFFECTIVE")
+13 SET USRREC=$$SETFLD^VALM1(USREXP,USRREC,"EXPIRES")
+14 SET USRREC=$$SETFLD^VALM1(USRCLNM,USRREC,"CLASS")
+15 SET ^TMP("USRMMBR",$JOB,+ITEM,0)=USRREC
+16 DO RESTORE^VALM10(+ITEM)
DO CNTRL^VALM10(+ITEM,1,VALM("RM"),IOINHI,IOINORM)
+17 QUIT