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

ACDPIMP1.m

Go to the documentation of this file.
  1. ACDPIMP1 ;IHS/ADC/EDE/KML - build entries from imported global;
  1. ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
  1. ;;
  1. ;******************************************************************
  1. ;Build CDMIS data files on area/HQ machine from the ^ACDPTMP global
  1. ;that has just been imported to the area/HQ machine
  1. ;****************************************************************
  1. EN ;EP
  1. ;//ACDPIMP
  1. ;Check for existence of data
  1. I '$D(^ACDPTMP) W !,"No data to import..." Q
  1. ;
  1. ;Validate incomming ASUFAC's are in the area location file
  1. ;ACDUSER is in the form 'DUZ(2)^PROGRAM ASSOCIATED WITH VISIT'
  1. ;
  1. W !! K ACDQUIT S ACDUSER="" F S ACDUSER=$O(^ACDPTMP(ACDUSER)) Q:ACDUSER="" W !,"Checking for the existence of ASUFAC: ",$P(ACDUSER,"*",2)," in your location file." I '$O(^AUTTLOC("C",$P(ACDUSER,"*",2),0)) S ACDQUIT=1 W *7," Missing.",!
  1. I $D(ACDQUIT) W !!,"Aborted...Contact your site manager immediately.." S ^ACDP1TMP=1 Q
  1. E W !!,"All facility codes exist. Proceeding with rebuild...",!
  1. ;
  1. ;
  1. RBL ;
  1. ;Rebuild program data here.
  1. S ACDUSER="" F S ACDUSER=$O(^ACDPTMP(ACDUSER)) Q:ACDUSER="" D
  1. .S ACDA=$O(^AUTTLOC("C",$P(ACDUSER,"*",2),0))
  1. .;
  1. .;Delete original entry if it exists
  1. .S DA=ACDA,DIK="^ACDQAN(" D ^DIK
  1. .L +^ACDQAN(ACDA):0 ; lock not needed/done for verification only
  1. .; locking non-existent entry, users locked out
  1. .;
  1. .S %Y="^ACDQAN("_ACDA_","
  1. .S %X="^ACDPTMP("""_ACDUSER_""","
  1. .D %XY^%RCR
  1. .;
  1. .;Reset .01 because it is dinumed
  1. .S $P(^ACDQAN(ACDA,0),U)=ACDA
  1. .L -^ACDQAN(ACDA)
  1. ;
  1. RDX ;
  1. ;Re-index all entries for B index
  1. K ^ACDQAN("B")
  1. S DIK(1)=".01^B"
  1. S DIK="^ACDQAN("
  1. D ENALL^DIK
  1. ;
  1. I $D(^ACDP1TMP) W !!,"Since this import is finished, now killing the ^ACDP1TMP global flag." K ^ACDP1TMP ; kill of scratch global SAC EXEMPTION (2.3.2.3 killing of unsubscripted globals is prohibited)
  1. K ;
  1. K ^ACDPTMP ; kill of scratch global
  1. Q