GMRVXPRE ;HIRMFO/RM-PREINITIALIZATION ROUTINE FOR VITALS ;7/19/96
;;4.0;Vitals/Measurements;;Apr 25, 1997
EN1 ; PRE-INITIALIZATION FOR THE VITALS PACKAGE
S GMRVER=$$VERSION^XPDUTL("GMRV") I +GMRVER=0 K GMRVER Q
I $$GET1^DID(120.5,1.4,"","LABEL")="*COMMENTS" D
. D BMES^XPDUTL("Deleting *COMMENTS field from 120.5 file...")
. S DA(1)=120.5,DA=1.4,DIK="^DD(120.5," D ^DIK
. Q
S (GMRVC,GMRVDA)=0 F S GMRVDA=$O(^GMRD(120.51,GMRVDA)) Q:GMRVDA'>0 D
. S GMRVHELP=$P($G(^GMRD(120.51,GMRVDA,0)),"^",6) Q:GMRVHELP'>0
. S GMRVHELP=$$GET1^DIQ(9.2,GMRVHELP_",",.01,"I") Q:GMRVHELP=""
. K GMRVFDA S GMRVFDA(99,120.51,GMRVDA_",",5)=GMRVHELP
. D FILE^DIE("","GMRVFDA(99)") I '$D(^TMP("DIERR",$J)),'GMRVC D
. . S GMRVC=1
. . D BMES^XPDUTL("Converting HELP FRAME data in 120.51 file...")
. . Q
. K ^TMP("DIERR",$J)
. Q
F GMRVFILE=120.52,120.53 D
. S GMRVFNM=$$GET1^DID(GMRVFILE,"","","NAME")
. S GMRVFINF=$P($T(@$P(GMRVFILE,".",2)),";;",2)
. I GMRVFNM=$P(GMRVFINF,";") D
. . S GMRVFNM=$P(GMRVFINF,";",2)
. . D BMES^XPDUTL("Changing name of file #"_GMRVFILE_" to "_GMRVFNM)
. . K DA,DIE,DR
. . S DIE="^DIC(",DA=GMRVFILE,DR=".01///^S X=GMRVFNM" D ^DIE
. . Q
. Q
D DELXREF(120.5,.01,"AA")
D DELXREF(120.5,.02,"AZ1")
D DELXREF(120.5,.03,"AZ2")
K GMRVFLD S GMRVDD="READ ACCESS;WRITE ACCESS;DELETE ACCESS"
D FIELD^DID(120.53,.01,"",GMRVDD,"GMRVFLD(120.53,.01)")
D FIELD^DID(120.53,1,"",GMRVDD,"GMRVFLD(120.53,1)")
D FIELD^DID(120.531,.01,"",GMRVDD,"GMRVFLD(120.531,.01)")
S GMRVFILE=0 F S GMRVFILE=$O(GMRVFLD(GMRVFILE)) Q:GMRVFILE'>0 D
. S GMRVFLD=0 F S GMRVFLD=$O(GMRVFLD(GMRVFILE,GMRVFLD)) Q:GMRVFLD'>0 F GMRVDD="READ ACCESS^8","WRITE ACCESS^9","DELETE ACCESS^8.5" D
. . S GMRVACC=$P(GMRVDD,"^")
. . I $G(GMRVFLD(GMRVFILE,GMRVFLD,GMRVACC))="^" D
. . . D BMES^XPDUTL("Removing "_GMRVACC_" for "_GMRVFLD_" field of "_GMRVFILE_" file/sub-file...")
. . . K ^DD(GMRVFILE,GMRVFLD,$P(GMRVDD,"^",2))
. . . Q
. . Q
. Q
D EN^GMRVXCH0
K DA,DIE,DIK,DR,GMRVACC,GMRVC,GMRVDA,GMRVDD,GMRVER,GMRVFDA,GMRVFILE
K GMRVFINF,GMRVFLD,GMRVFNM,GMRVHELP
Q
FILES ;;Old File Name;New File Name
52 ;;GMRV VITAL SITE;GMRV VITAL QUALIFIER
53 ;;GMRV VITAL QUALITY;GMRV VITAL CATEGORY
Q
DELXREF(GMRVFILE,GMRVFLD,GMRVIX) ; This procedure will delete the
; cross-refernce for specified file and field.
; Input variables: GMRVFILE=file number
; GMRVFLD=field number
; GMRVIX=xref name
;
N GMRV1,GMRVIXDA
S (GMRV1,GMRVIXDA)=0
F S GMRVIXDA=$O(^DD(GMRVFILE,GMRVFLD,1,GMRVIXDA)) Q:GMRVIXDA'>0 D
. I $P($G(^DD(GMRVFILE,GMRVFLD,1,GMRVIXDA,0)),"^",2)=GMRVIX D
. . I 'GMRV1 D
. . . S GMRV1=1
. . . D BMES^XPDUTL("Deleting """_GMRVIX_""" xref for "_GMRVFLD_" field of "_GMRVFILE_" file...")
. . . Q
. . K ^DD(GMRVFILE,0,"IX",GMRVIX,GMRVFILE,GMRVFLD)
. . K ^DD(GMRVFILE,GMRVFLD,1,GMRVIXDA)
. . Q
. Q
Q
GMRVXPRE ;HIRMFO/RM-PREINITIALIZATION ROUTINE FOR VITALS ;7/19/96
+1 ;;4.0;Vitals/Measurements;;Apr 25, 1997
EN1 ; PRE-INITIALIZATION FOR THE VITALS PACKAGE
+1 SET GMRVER=$$VERSION^XPDUTL("GMRV")
IF +GMRVER=0
KILL GMRVER
QUIT
+2 IF $$GET1^DID(120.5,1.4,"","LABEL")="*COMMENTS"
Begin DoDot:1
+3 DO BMES^XPDUTL("Deleting *COMMENTS field from 120.5 file...")
+4 SET DA(1)=120.5
SET DA=1.4
SET DIK="^DD(120.5,"
DO ^DIK
+5 QUIT
End DoDot:1
+6 SET (GMRVC,GMRVDA)=0
FOR
SET GMRVDA=$ORDER(^GMRD(120.51,GMRVDA))
IF GMRVDA'>0
QUIT
Begin DoDot:1
+7 SET GMRVHELP=$PIECE($GET(^GMRD(120.51,GMRVDA,0)),"^",6)
IF GMRVHELP'>0
QUIT
+8 SET GMRVHELP=$$GET1^DIQ(9.2,GMRVHELP_",",.01,"I")
IF GMRVHELP=""
QUIT
+9 KILL GMRVFDA
SET GMRVFDA(99,120.51,GMRVDA_",",5)=GMRVHELP
+10 DO FILE^DIE("","GMRVFDA(99)")
IF '$DATA(^TMP("DIERR",$JOB))
IF 'GMRVC
Begin DoDot:2
+11 SET GMRVC=1
+12 DO BMES^XPDUTL("Converting HELP FRAME data in 120.51 file...")
+13 QUIT
End DoDot:2
+14 KILL ^TMP("DIERR",$JOB)
+15 QUIT
End DoDot:1
+16 FOR GMRVFILE=120.52,120.53
Begin DoDot:1
+17 SET GMRVFNM=$$GET1^DID(GMRVFILE,"","","NAME")
+18 SET GMRVFINF=$PIECE($TEXT(@$PIECE(GMRVFILE,".",2)),";;",2)
+19 IF GMRVFNM=$PIECE(GMRVFINF,";")
Begin DoDot:2
+20 SET GMRVFNM=$PIECE(GMRVFINF,";",2)
+21 DO BMES^XPDUTL("Changing name of file #"_GMRVFILE_" to "_GMRVFNM)
+22 KILL DA,DIE,DR
+23 SET DIE="^DIC("
SET DA=GMRVFILE
SET DR=".01///^S X=GMRVFNM"
DO ^DIE
+24 QUIT
End DoDot:2
+25 QUIT
End DoDot:1
+26 DO DELXREF(120.5,.01,"AA")
+27 DO DELXREF(120.5,.02,"AZ1")
+28 DO DELXREF(120.5,.03,"AZ2")
+29 KILL GMRVFLD
SET GMRVDD="READ ACCESS;WRITE ACCESS;DELETE ACCESS"
+30 DO FIELD^DID(120.53,.01,"",GMRVDD,"GMRVFLD(120.53,.01)")
+31 DO FIELD^DID(120.53,1,"",GMRVDD,"GMRVFLD(120.53,1)")
+32 DO FIELD^DID(120.531,.01,"",GMRVDD,"GMRVFLD(120.531,.01)")
+33 SET GMRVFILE=0
FOR
SET GMRVFILE=$ORDER(GMRVFLD(GMRVFILE))
IF GMRVFILE'>0
QUIT
Begin DoDot:1
+34 SET GMRVFLD=0
FOR
SET GMRVFLD=$ORDER(GMRVFLD(GMRVFILE,GMRVFLD))
IF GMRVFLD'>0
QUIT
FOR GMRVDD="READ ACCESS^8","WRITE ACCESS^9","DELETE ACCESS^8.5"
Begin DoDot:2
+35 SET GMRVACC=$PIECE(GMRVDD,"^")
+36 IF $GET(GMRVFLD(GMRVFILE,GMRVFLD,GMRVACC))="^"
Begin DoDot:3
+37 DO BMES^XPDUTL("Removing "_GMRVACC_" for "_GMRVFLD_" field of "_GMRVFILE_" file/sub-file...")
+38 KILL ^DD(GMRVFILE,GMRVFLD,$PIECE(GMRVDD,"^",2))
+39 QUIT
End DoDot:3
+40 QUIT
End DoDot:2
+41 QUIT
End DoDot:1
+42 DO EN^GMRVXCH0
+43 KILL DA,DIE,DIK,DR,GMRVACC,GMRVC,GMRVDA,GMRVDD,GMRVER,GMRVFDA,GMRVFILE
+44 KILL GMRVFINF,GMRVFLD,GMRVFNM,GMRVHELP
+45 QUIT
FILES ;;Old File Name;New File Name
52 ;;GMRV VITAL SITE;GMRV VITAL QUALIFIER
53 ;;GMRV VITAL QUALITY;GMRV VITAL CATEGORY
+1 QUIT
DELXREF(GMRVFILE,GMRVFLD,GMRVIX) ; This procedure will delete the
+1 ; cross-refernce for specified file and field.
+2 ; Input variables: GMRVFILE=file number
+3 ; GMRVFLD=field number
+4 ; GMRVIX=xref name
+5 ;
+6 NEW GMRV1,GMRVIXDA
+7 SET (GMRV1,GMRVIXDA)=0
+8 FOR
SET GMRVIXDA=$ORDER(^DD(GMRVFILE,GMRVFLD,1,GMRVIXDA))
IF GMRVIXDA'>0
QUIT
Begin DoDot:1
+9 IF $PIECE($GET(^DD(GMRVFILE,GMRVFLD,1,GMRVIXDA,0)),"^",2)=GMRVIX
Begin DoDot:2
+10 IF 'GMRV1
Begin DoDot:3
+11 SET GMRV1=1
+12 DO BMES^XPDUTL("Deleting """_GMRVIX_""" xref for "_GMRVFLD_" field of "_GMRVFILE_" file...")
+13 QUIT
End DoDot:3
+14 KILL ^DD(GMRVFILE,0,"IX",GMRVIX,GMRVFILE,GMRVFLD)
+15 KILL ^DD(GMRVFILE,GMRVFLD,1,GMRVIXDA)
+16 QUIT
End DoDot:2
+17 QUIT
End DoDot:1
+18 QUIT