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

IBDFC3.m

Go to the documentation of this file.
  1. IBDFC3 ;ALB/CJM - ENCOUNTER FORM - replace original form with converted form ;MAR 3, 1995
  1. ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
  1. ;
  1. REPLACE ;replaces the original form with the converted form
  1. N IBFORM,OLDFORM,IBCNVRT,NODE,OLDNAME,NEWNAME
  1. S VALMBCK="R"
  1. ;D FULL^VALM1
  1. W !,"The original form will be replaced with the converted form in all of the",!,"clinics and divisions where it is used."
  1. K DIR S DIR(0)="Y",DIR("B")="YES",DIR("A")="Is that okay"
  1. D ^DIR K DIR
  1. I (Y=1)&'$D(DIRUT) D
  1. .X IBAPI("SELECT")
  1. .Q:'IBFORM
  1. .Q:'IBCNVRT
  1. .S NODE=$G(^IBD(359,IBCNVRT,0))
  1. .S OLDFORM=$P(NODE,"^",2),OLDNAME=$P(NODE,"^",3)
  1. .Q:'OLDFORM
  1. .D LOOP
  1. .S $P(^IBD(359,IBCNVRT,0),"^",5)=1
  1. .;
  1. .;delete the original?
  1. .W !,"The converted form has been substituted everywhere for the original"
  1. .S DIR(0)="Y",DIR("B")="YES",DIR("A")="Do you want the original form deleted"
  1. .D ^DIR K DIR
  1. .I (Y=1)&'$D(DIRUT) D
  1. ..D DELETE^IBDFU2C(OLDFORM,357)
  1. ..;rename the converted form to take out the CNV. prefix
  1. ..S NAME=$P($G(^IBE(357,IBFORM,0)),"^") I $E(NAME,1,4)="CNV." S NAME=$E(NAME,5,45) S:(NAME=$E(OLDNAME,1,$L(NAME))) NAME=OLDNAME D
  1. ...K DIE,DA,DR S DIE="^IBE(357,",DA=IBFORM,DR=".01////"_NAME D ^DIE K DIE,DA,DR
  1. .;
  1. .D IDXFORMS^IBDFC1
  1. K Y
  1. Q
  1. ;
  1. LOOP ;loops through the clinic setups and divisions setups, making the substitutions
  1. N SETUP,NODE,PIECE,FOUND
  1. S SETUP=0 F S SETUP=$O(^SD(409.95,SETUP)) Q:'SETUP D
  1. .S NODE=$G(^SD(409.95,SETUP,0))
  1. .K DR S DR=""
  1. .S FOUND=0
  1. .F PIECE=2:1:12 I $P(NODE,"^",PIECE)=OLDFORM S DR=DR_(.01*PIECE)_"////"_IBFORM_";",FOUND=1
  1. .I FOUND K DIE,DA S DIE="^SD(409.95,",DA=SETUP D ^DIE
  1. .K DIE,DR,DA
  1. Q