Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: GMRVXPRE

GMRVXPRE.m

Go to the documentation of this file.
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