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

IBDF9B3.m

Go to the documentation of this file.
  1. IBDF9B3 ;ALB/CJM - ENCOUNTER FORM - (edit,delete,add data fields) ;FEB 1,1993
  1. ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
  1. ;
  1. LABELS ;Create, Edit, or Delete LABELS from the form
  1. I Y="I" D LABELS^IBDF9B3 Q
  1. ;
  1. N IBVALMBG,QUIT
  1. S QUIT=0
  1. S IBVALMBG=VALMBG
  1. S VALMBCK="R"
  1. ;
  1. F D Q:QUIT
  1. .D FULL^VALM1
  1. .K DIR S DIR("?",1)="You can Create, Edit, or Delete labels, Shift all of the labels AND data",DIR("?")="fields within a range up or down."
  1. .W !!,DIR("?",1),!,DIR("?"),!
  1. .S DIR("B")="C",DIR(0)="SB^C:Create;E:Edit;D:Delete;S:Shift;Q:Quit",DIR("A")="[C]reate, [D]elete, [E]dit, [S]hift, [Q]uit"
  1. .D ^DIR K DIR I $D(DIRUT)!(Y<0) S QUIT=1 Q
  1. .I Y="Q" S QUIT=1 Q
  1. .D @$S(Y="C":"NEWFLD",Y="E":"EDITFLD",Y="D":"DLTFLD",Y="S":"SHIFT",1:"")
  1. .D RE^VALM4
  1. S VALMBCK="R",VALMBG=IBVALMBG
  1. Q
  1. SHIFT ;expects IBBLK to be defined - shifts all fields within range supplied by user
  1. D SHIFT^IBDF10("D")
  1. D UNCMPBLK^IBDF19(IBBLK),IDXBLOCK^IBDFU4
  1. Q
  1. EDITFLD ;expects IBBLK to be defined
  1. N IBFIELD,NOD
  1. N IBI,IBOLD,IBX,IBY,IBW,IBDELETE ;these are used in the input template
  1. D SELECT
  1. I IBFIELD D
  1. .D RE^VALM4
  1. .S IBOLD=1,(IBX,IBY)=""
  1. .K DR,DIE,DA S DIE=357.5,DA=IBFIELD,DR="[IBDF EDIT LABEL FIELD]",DIE("NO^")="BACKOUTOK" D ^DIE K DIE,DR,DA
  1. .D UNCMPBLK^IBDF19(IBBLK),IDXBLOCK^IBDFU4
  1. Q
  1. SELECT ;
  1. S IBFIELD=0
  1. Q:'$G(IBBLK)
  1. I '$O(^IBE(357.5,"C",IBBLK,0)) W !,"There is no label only field!" D PAUSE^IBDFU5 Q
  1. AGAIN K DIC S DIC="^IBE(357.5,",DIC(0)="EFQ",DIC("B")="",D="C",X=IBBLK
  1. S DIC("S")="I $P(^(0),U,2)=IBBLK,+$P(^(0),U,3)=0"
  1. D IX^DIC K DIC
  1. S:+Y>0 IBFIELD=+Y
  1. I 'IBFIELD,'$D(DTOUT),'$D(DUOUT) K DIR S DIR(0)="Y",DIR("A")="No label selected! Try again",DIR("B")="YES" D ^DIR K DIR I '$D(DIRUT),Y=1 G AGAIN
  1. Q
  1. DLTFLD ;expects IBBLK to be defined
  1. N IBFIELD
  1. D SELECT
  1. I IBFIELD D
  1. .Q:'$$RUSURE^IBDFU5($P($G(^IBE(357.5,IBFIELD,0)),"^"))
  1. .D DLTFLD^IBDFU3(357.5,IBBLK,IBFIELD)
  1. .D UNCMPBLK^IBDF19(IBBLK),IDXBLOCK^IBDFU4
  1. Q
  1. NEWFLD ;adds a new field, expects IBBLK to be defined
  1. N NAME,FIELD,NODE,IBRTN,DLAYGO
  1. N IBX,IBY,IBW,IBDELETE,IBOLD ;these are used in the input template
  1. S NAME=$$NEWNAME^IBDF9B Q:NAME=-1
  1. S IBOLD=0,(IBX,IBY)=""
  1. K DIC,DIE,DD,DO,DINUM S DIC="^IBE(357.5,",DIC(0)="FL",X=NAME,DLAYGO=357.5
  1. D FILE^DICN K DIC,DIE,DA
  1. S FIELD=$S(+Y<0:"",1:+Y)
  1. I 'FIELD D
  1. .W !,"Unable to create a new label!" D PAUSE^IBDFU5
  1. I FIELD D
  1. .S IBDELETE=1
  1. .D RE^VALM4
  1. .K DIE,DA,DR S DIE=357.5,DA=FIELD,DR="[IBDF EDIT LABEL FIELD]",DIE("NO^")="BACKOUTOK" D ^DIE K DIE,DR,DA,DIC
  1. .I IBDELETE K DA S DIK="^IBE(357.5,",DA=FIELD D ^DIK K DIK,DA Q
  1. .D UNCMPBLK^IBDF19(IBBLK),IDXBLOCK^IBDFU4
  1. Q