VPRIDX ;SLC/MKB/BLJ -- Create AVPR index ;10/25/18 15:29
;;1.0;VIRTUAL PATIENT RECORD;**8,28**;Sep 01, 2011;Build 6
;;Per VA Directive 6402, this routine should not be modified.
Q
;
EN ; -- create index
D GMRV
;
Q
;
GMRV ; -- create AVPR index on GMRV Measurement file #120.5
N VPRX,VPRY
S VPRX("FILE")=120.5
S VPRX("NAME")="AVPR"
S VPRX("TYPE")="MU"
S VPRX("USE")="A"
S VPRX("EXECUTION")="R"
S VPRX("ACTIVITY")=""
S VPRX("SHORT DESCR")="Trigger updates to VPR"
S VPRX("DESCR",1)="This is an action index that updates the Virtual Patient Record (VPR)"
S VPRX("DESCR",2)="when any of the fields in this index are changed. No actual cross-"
S VPRX("DESCR",3)="reference nodes are set or killed."
S VPRX("SET")="D GMRV^VPREVNT(X(1),DA,$G(X(3)))"
S VPRX("KILL")="Q"
S VPRX("WHOLE KILL")="Q"
S VPRX("VAL",1)=.02 ;Patient
S VPRX("VAL",2)=1.2 ;Rate
S VPRX("VAL",3)=2 ;Entered in Error
D CREIXN^DDMOD(.VPRX,"kW",.VPRY) ;VPRY=ien^name of index
Q
;;
PCMM ; -- create ADP index on POSITION ASSIGNMENT HISTORY file #404.52
Q:$D(^SCTM(404.52,"ADP")) ;exists [ICR #7174]
N VPRX,VPRY,I
S VPRX("FILE")=404.52
S VPRX("NAME")="ADP"
S VPRX("TYPE")="R"
S VPRX("USE")="S"
S VPRX("EXECUTION")="R"
S VPRX("SHORT DESCR")="Sort Assignments by Date & Position"
S VPRX("DESCR",1)="This regular index sorts assignment changes by Effective Date and Position."
;
S VPRX("SET")="S ^SCTM(404.52,""ADP"",X(1),X(2),DA)="""""
S VPRX("KILL")="K ^SCTM(404.52,""ADP"",X(1),X(2),DA)"
S VPRX("WHOLE KILL")="K ^SCTM(404.52,""ADP"")"
S VPRX("VAL",1)=.02 ;Effective Date
S VPRX("VAL",2)=.01 ;Team Position
F I=1,2 S VPRX("VAL",I,"SUBSCRIPT")=I,VPRX("VAL",I,"COLLATION")="F"
D CREIXN^DDMOD(.VPRX,"kW",.VPRY) ;VPRY=ien^name of index
;
; queue job to create index in background overnight
I $G(VPRY) D
. N ZTRTN,ZTDTH,ZTDESC,ZTIO,ZTSAVE,ZTUCI,ZTCPU,ZTPRI,ZTKIL,ZTSYNC,ZTSK
. S ZTRTN="SCTM^VPRIDX",ZTDESC="Create SCTM ADP index",ZTIO=""
. S ZTDTH=DT_".2355"
. D ^%ZTLOAD
. I $G(ZTSK) D BMES^XPDUTL("Task #"_ZTSK_" created to build index nodes.") Q
. D BMES^XPDUTL("UNABLE TO QUEUE JOB TO CREATE ADP INDEX NODES!")
. D MES^XPDUTL("Use the VA FileMan Utility option to create the ADP index.")
Q
;
SCTM ; -- create index nodes
N DIK S DIK="^SCTM(404.52,"
S DIK(1)=".01^ADP"
D ENALL^DIK
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVPRIDX 2433 printed Dec 13, 2024@02:45:22 Page 2
VPRIDX ;SLC/MKB/BLJ -- Create AVPR index ;10/25/18 15:29
+1 ;;1.0;VIRTUAL PATIENT RECORD;**8,28**;Sep 01, 2011;Build 6
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 QUIT
+4 ;
EN ; -- create index
+1 DO GMRV
+2 ;
+3 QUIT
+4 ;
GMRV ; -- create AVPR index on GMRV Measurement file #120.5
+1 NEW VPRX,VPRY
+2 SET VPRX("FILE")=120.5
+3 SET VPRX("NAME")="AVPR"
+4 SET VPRX("TYPE")="MU"
+5 SET VPRX("USE")="A"
+6 SET VPRX("EXECUTION")="R"
+7 SET VPRX("ACTIVITY")=""
+8 SET VPRX("SHORT DESCR")="Trigger updates to VPR"
+9 SET VPRX("DESCR",1)="This is an action index that updates the Virtual Patient Record (VPR)"
+10 SET VPRX("DESCR",2)="when any of the fields in this index are changed. No actual cross-"
+11 SET VPRX("DESCR",3)="reference nodes are set or killed."
+12 SET VPRX("SET")="D GMRV^VPREVNT(X(1),DA,$G(X(3)))"
+13 SET VPRX("KILL")="Q"
+14 SET VPRX("WHOLE KILL")="Q"
+15 ;Patient
SET VPRX("VAL",1)=.02
+16 ;Rate
SET VPRX("VAL",2)=1.2
+17 ;Entered in Error
SET VPRX("VAL",3)=2
+18 ;VPRY=ien^name of index
DO CREIXN^DDMOD(.VPRX,"kW",.VPRY)
+19 QUIT
+20 ;;
PCMM ; -- create ADP index on POSITION ASSIGNMENT HISTORY file #404.52
+1 ;exists [ICR #7174]
if $DATA(^SCTM(404.52,"ADP"))
QUIT
+2 NEW VPRX,VPRY,I
+3 SET VPRX("FILE")=404.52
+4 SET VPRX("NAME")="ADP"
+5 SET VPRX("TYPE")="R"
+6 SET VPRX("USE")="S"
+7 SET VPRX("EXECUTION")="R"
+8 SET VPRX("SHORT DESCR")="Sort Assignments by Date & Position"
+9 SET VPRX("DESCR",1)="This regular index sorts assignment changes by Effective Date and Position."
+10 ;
+11 SET VPRX("SET")="S ^SCTM(404.52,""ADP"",X(1),X(2),DA)="""""
+12 SET VPRX("KILL")="K ^SCTM(404.52,""ADP"",X(1),X(2),DA)"
+13 SET VPRX("WHOLE KILL")="K ^SCTM(404.52,""ADP"")"
+14 ;Effective Date
SET VPRX("VAL",1)=.02
+15 ;Team Position
SET VPRX("VAL",2)=.01
+16 FOR I=1,2
SET VPRX("VAL",I,"SUBSCRIPT")=I
SET VPRX("VAL",I,"COLLATION")="F"
+17 ;VPRY=ien^name of index
DO CREIXN^DDMOD(.VPRX,"kW",.VPRY)
+18 ;
+19 ; queue job to create index in background overnight
+20 IF $GET(VPRY)
Begin DoDot:1
+21 NEW ZTRTN,ZTDTH,ZTDESC,ZTIO,ZTSAVE,ZTUCI,ZTCPU,ZTPRI,ZTKIL,ZTSYNC,ZTSK
+22 SET ZTRTN="SCTM^VPRIDX"
SET ZTDESC="Create SCTM ADP index"
SET ZTIO=""
+23 SET ZTDTH=DT_".2355"
+24 DO ^%ZTLOAD
+25 IF $GET(ZTSK)
DO BMES^XPDUTL("Task #"_ZTSK_" created to build index nodes.")
QUIT
+26 DO BMES^XPDUTL("UNABLE TO QUEUE JOB TO CREATE ADP INDEX NODES!")
+27 DO MES^XPDUTL("Use the VA FileMan Utility option to create the ADP index.")
End DoDot:1
+28 QUIT
+29 ;
SCTM ; -- create index nodes
+1 NEW DIK
SET DIK="^SCTM(404.52,"
+2 SET DIK(1)=".01^ADP"
+3 DO ENALL^DIK
+4 QUIT