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

OCXOED12.m

Go to the documentation of this file.
OCXOED12 ;SLC/RJS,CLA - Rule Editor (Data Field Options) ;3/22/01  10:46
 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,105**;Dec 17,1997
 ;;  ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
 ;
 ;
S ;
 ;
 Q
EN(OCXD0,OCXRD,OCXACT) ;
 ;
 ;
 N OCXTHLN,OCXTNLN,OCXTRLN,OCXTULN,OCXTNLN
 ;
 S OCXTNLN=$C(27,91,48,109),OCXTRLN=$C(27,91,55,109),OCXTULN=$C(27,91,52,109),OCXTHLN=$C(27,91,49,109)
 ;
 S OCXOPT=$$GETOPT^OCXOEDT(.OCXACT) Q:(OCXOPT=U) 1 X:$L(OCXOPT) OCXOPT
 ;
 Q:'$D(^OCXS(860.4,OCXD0)) 1
 ;
 Q 0
 ;
 ;
EDIT(OCXD0) ;
 N X S X=$$DIE("^OCXS(860.4,",OCXD0,".01;1")
 Q
 ;
 ;
 D EN^OCXOED13(OCXD1,OCXSRC)
 Q
 ;
LOPT(OCXMODE,OCXD0) ;
 ;
 N OCXD1,OCXLINK,OCXSRC
 ;
 I OCXMODE="ADD" D  Q
 .S:'$D(^OCXS(860.4,OCXD0,"LINK",0)) ^OCXS(860.4,OCXD0,"LINK",0)="^860.41P^^"
 .S OCXD1=+$$DIC("^OCXS(860.6,","AEMQL","Data Context: ") Q:'OCXD1
 .S OCXSRC=+$$DIC("^OCXS(860.5,","AEMQL"," Data Source: ") Q:'OCXSRC
 .S OCXLINK=$G(^OCXS(860.4,OCXD0,"LINK",OCXD1,"DATAPATH"))
 .S:(OCXLINK[U) OCXLINK=$P(OCXLINK,U,2)
 .S OCXLINK=$$DIC("^OCXS(863.3,","AEMQL","Link Name: ",OCXLINK) Q:'OCXLINK
 .S ^OCXS(860.4,OCXD0,"LINK",OCXD1,0)=OCXD1_U_OCXSRC
 .S ^OCXS(860.4,OCXD0,"LINK",OCXD1,"DATAPATH")=$P(OCXLINK,U,2)
 .S ^OCXS(860.4,OCXD0,"LINK","B",OCXD1,OCXD1)=""
 .D EN^OCXOED13($P(OCXLINK,U,2),OCXD1)
 I OCXMODE="DEL" D  Q
 .S:'$D(^OCXS(860.4,OCXD0,"LINK",0)) ^OCXS(860.4,OCXD0,"LINK",0)="^860.41P^^"
 .N OCXD1,DA S DA(1)=OCXD0,OCXD1=+$$DIC("^OCXS(860.4,"_(+OCXD0)_",""LINK"",","AEMQ","Select Data Source to delete: ") Q:'OCXD1
 .Q:'$$READ("Y","Are you sure you want to Delete ?","YES")
 .Q:'$$DIE("^OCXS(860.4,"_(+OCXD0)_",""LINK"",",OCXD1,"S DA(1)="_(+OCXD0)_";.01///@")
 .W !!,"Deleted..." H 1
 Q
 ;
 ;
 N OCXD1,OCXLINK,OCXX,DA
 ;
 S ^OCXS(860.4,OCXD0,"LINK",OCXD1,0)=OCXD1
 S ^OCXS(860.4,OCXD0,"LINK",OCXD1,"DATAPATH")=OCXLINK
 S ^OCXS(860.4,OCXD0,"LINK","B",OCXD1,OCXD1)=""
 D EN^OCXOED13(OCXLINK,OCXD1)
 Q
 ;
COMP ;
 D ^OCXOCMP
 Q
 ;
 ;
READ(OCXZ0,OCXZA,OCXZB,OCXZL) ;
 N OCXLINE,DIR,DTOUT,DUOUT,DIRUT,DIROUT
 Q:'$L($G(OCXZ0)) U
 S DIR(0)=OCXZ0
 S:$L($G(OCXZA)) DIR("A")=OCXZA
 S:$L($G(OCXZB)) DIR("B")=OCXZB
 F OCXLINE=1:1:($G(OCXZL)-1) W !
 D ^DIR
 I $D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT) Q U
 Q Y
 ;
DIE(DIE,DA,DR) ;
 ;
 D RM(IOM) N DUOUT,DTOUT,DIC S DIC=DIE D ^DIE D RM(0) Q:$G(DTOUT) 0 Q:$G(DUOUT) 0 Q 1
 ;
RM(X) X ^%ZOSF("RM") Q
 ;
DIC(OCXDIC,OCXDIC0,OCXDICA,OCXDICB,OCXX,OCXDICS,OCXDR,DA) ;
 ;
 N DIC,X,Y
 S DIC=$G(OCXDIC) Q:'$L(DIC) -1
 S DIC(0)=$G(OCXDIC0) S:$L($G(OCXX)) X=OCXX
 S:$L($G(OCXDICS)) DIC("S")=OCXDICS
 S:$L($G(OCXDICA)) DIC("A")=OCXDICA
 S:$L($G(OCXDICB)) DIC("B")=OCXDICB
 S:$L($G(OCXDR)) DIC("DR")=OCXDR
 D ^DIC Q:(Y<1) 0 Q Y
 ;
SCREEN(TEXT,FLDNAME) ;
 ;
 Q:'($G(TEXT)["|") TEXT
 W !!,$G(FLDNAME)," Embedded Data Field Check..."
 N DF,DFIEN,PTR,WARN,NODE0,NODE1
 S WARN=0 F PTR=2:2:$L(TEXT,"|") S DF=$P(TEXT,"|",PTR) S:DF["." DF=$P(DF,".",2) D
 .S DFIEN=0 F  S DFIEN=$O(^OCXS(860.4,"B",$E(DF,1,30),DFIEN)) Q:'DFIEN  Q:($P($G(^OCXS(860.4,DFIEN,0)),U,1)=DF)
 .S:'DFIEN DFIEN=$O(^OCXS(860.4,"C",DF,0))
 .S NODE0=$G(^OCXS(860.4,+DFIEN,0)),NODE1=$G(^OCXS(860.4,+DFIEN,1))
 .;
 .I 'DFIEN!'$L(NODE0) D  Q:'DFIEN
 ..N NEWVAL
 ..S NEWVAL="",DFIEN=0,WARN=1 W !,$C(7),"Warning: Data Field '",DF,"'",!," is not in Data Field File."
 ..Q:'$$READ("Y","Do you want to substitute another field ?","YES")
 ..S DFIEN=+$$DIC("^OCXS(860.4,","AEMQ","Data Field: ") Q:'DFIEN
 ..S NODE0=$G(^OCXS(860.4,+DFIEN,0)),NODE1=$G(^OCXS(860.4,+DFIEN,1))
 ..I $L($P(NODE1,U,1)) S NEWVAL=$P(NODE1,U,1)
 ..I '$L(NEWVAL),$L($P(NODE0,U,1)) S NEWVAL=$P(NODE0,U,1)
 ..I $L(NEWVAL) S:($P(TEXT,"|",PTR)[".") NEWVAL=$P($P(TEXT,"|",PTR),".",1)_"."_NEWVAL S $P(TEXT,"|",PTR)=NEWVAL
 .;
 .W !,$J(DFIEN,5)
 .W ?10,$E($P(NODE1,U,1),1,20)
 .W ?31,$E($P(NODE0,U,1),1,40)
 .W $S(($L($P(NODE0,U,1))>40):"...",1:"")
 I 'WARN W !!,"Everything OK !!" H 1
 Q TEXT
 ;