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

PXRMV1IG.m

Go to the documentation of this file.
  1. PXRMV1IG ; SLC/PKR - Inits for new REMINDER package (globals).;05/19/2000
  1. ;;1.5;CLINICAL REMINDERS;;Jun 19, 2000
  1. ;
  1. ;These routines are used to help converting from old style B
  1. ;cross-references to new style full length cross-references.
  1. ;
  1. ;=======================================================================
  1. REINDEX(FILE) ;Rebuild all cross-references in a file.
  1. ;the second entry is the duplicate.
  1. N DIK,TEXT
  1. S TEXT="Rebuilding cross-references in file # "_FILE
  1. D BMES^XPDUTL(TEXT)
  1. S DIK=$$ROOT^DILFD(FILE)
  1. I DIK="" Q
  1. D IXALL^DIK
  1. Q
  1. ;
  1. ;=======================================================================
  1. RMDUP(FILE) ;Remove any duplicate entries from file number FILE. We assume
  1. ;the second entry is the duplicate.
  1. N DA,DIK,IEN1,IEN2,NAME,NAME1,NAME2,ROOT,ROOTB,TEMP,TEMP1,TEXT
  1. S TEXT="Checking for duplicate entries in file # "_FILE
  1. D BMES^XPDUTL(TEXT)
  1. S ROOT=$$ROOT^DILFD(FILE)
  1. I ROOT="" Q
  1. S DIK=ROOT
  1. S ROOTB=ROOT_"""B"","
  1. S NAME=""
  1. S TEMP=ROOTB_""""_NAME_""")"
  1. F S NAME=$O(@TEMP) Q:NAME="" D
  1. . S TEMP=ROOTB_""""_NAME_""")"
  1. . S TEMP1=ROOTB_""""_NAME_""","""")"
  1. . S IEN1=$O(@TEMP1)
  1. . S TEMP1=ROOTB_""""_NAME_""","_IEN1_")"
  1. . S IEN2=$O(@TEMP1)
  1. . I +IEN2>0 D
  1. .. S TEMP1=ROOT_IEN1_",0)"
  1. .. S NAME1=$P(@TEMP1,U,1)
  1. .. S TEMP1=ROOT_IEN2_",0)"
  1. .. S NAME2=$P(@TEMP1,U,1)
  1. .. I NAME1=NAME2 D
  1. ... S TEXT="Removing duplicate entry "_IEN2_" for "_NAME
  1. ... D BMES^XPDUTL(TEXT)
  1. ... S DA=IEN2
  1. ...;Kill nodes 4,6,10, and 20 so none of the cross-references are fired.
  1. ... I FILE=811.9 D
  1. .... K ^PXD(811.9,IEN2,4)
  1. .... K ^PXD(811.9,IEN2,6)
  1. .... K ^PXD(811.9,IEN2,10)
  1. .... K ^PXD(811.9,IEN2,20)
  1. ... D ^DIK
  1. Q
  1. ;
  1. ;=======================================================================
  1. TMPB(FILE) ;Delete the old B cross-reference and build a new temporary
  1. ;full length one so the install will find matches. FILE is the file
  1. ;number.
  1. N BXREF,IEN,NAME,ROOT,ROOTB,TEMP
  1. S ROOT=$$ROOT^DILFD(FILE)
  1. I ROOT="" Q
  1. S ROOTB=ROOT_"""B"")"
  1. ;Delete the old B.
  1. K @ROOTB
  1. S ROOTB=ROOT_"""B"","""
  1. S IEN=0
  1. F S ENTRY=ROOT_IEN_")",IEN=$O(@ENTRY) Q:+IEN=0 D
  1. . S TEMP=ROOT_IEN_",0)"
  1. . S NAME=$P(@TEMP,U,1)
  1. . S BXREF=ROOTB_NAME_""","_IEN_")"
  1. . S @(BXREF)=""
  1. Q
  1. ;
  1. ;=======================================================================
  1. INSAV ;Save inactive status of VA Reminders to file
  1. N NAME,SUB
  1. K ^TMP("PXRMV1IG",$J)
  1. S NAME="VA"
  1. F S NAME=$O(^PXD(811.9,"B",NAME)) Q:$E(NAME,1,3)'="VA-" D
  1. .S SUB=$O(^PXD(811.9,"B",NAME,"")) Q:'SUB Q:'$D(^PXD(811.9,SUB,0))
  1. .S ^TMP("PXRMV1IG",$J,NAME)=$P($G(^PXD(811.9,SUB,0)),U,6)
  1. Q
  1. ;
  1. ;=======================================================================
  1. INRES ;Restore inactive status of VA reminders
  1. N NAME,SUB,STA
  1. S NAME=""
  1. F S NAME=$O(^TMP("PXRMV1IG",$J,NAME)) Q:NAME="" D
  1. .S STA=$G(^TMP("PXRMV1IG",$J,NAME))
  1. .S SUB=$O(^PXD(811.9,"B",NAME,"")) Q:'SUB
  1. .S:$D(^PXD(811.9,SUB,0)) $P(^PXD(811.9,SUB,0),U,6)=STA
  1. K ^TMP("PXRMV1IG",$J)
  1. Q
  1. ;
  1. ;=======================================================================
  1. CHANGE ;Rename old menu entries so they get overwritten
  1. D CHGNAM("PXRM REMINDER MENU","PXRM MANAGERS MENU")
  1. Q
  1. ;
  1. ;=======================================================================
  1. CHGNAM(OLD,NEW) ;Change option name
  1. ;Skip if the new entry already exists
  1. I $D(^DIC(19,"B",NEW)) Q
  1. ;Rename option
  1. N DA,DIE,DR,X
  1. S DA=$O(^DIC(19,"B",OLD,"")) Q:'DA
  1. S DIE="^DIC(19,",DR=".01///^S X=NEW"
  1. D ^DIE
  1. Q