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

OCXOED16.m

Go to the documentation of this file.
OCXOED16 ;SLC/RJS,CLA - Rule Editor (Expert System Editor Options) ;6/19/01  16:35
 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,105**;Dec 17,1997
 ;;  ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
 ;
 ;
S ;
 ;
 Q
EN(OCXACT) ;
 ;
 ;
 N OCXTHLN,OCXTNLN,OCXTRLN,OCXTULN,OCXTNLN
 ;
 S OCXOPT=$$GETOPT^OCXOEDT(.OCXACT) Q:(OCXOPT=U) 1 X:$L(OCXOPT) OCXOPT
 ;
 Q 0
 ;
EDRULE ;
 ;
 N OCXY F  W !! S OCXY=+$$DIC("^OCXS(860.2,","AEMQNL","Select Rule: ") Q:'OCXY  D EN^OCXOED01(OCXY)
 ;
 Q
 ;
EDELEM ;
 ;
 N OCXY F  W !! S OCXY=+$$DIC("^OCXS(860.3,","AEMQNL","Select Element: ") Q:'OCXY  D EN^OCXOED07(OCXY)
 ;
 Q
 ;
EDDF ;
 ;
 N OCXY F  W !! S OCXY=+$$DIC("^OCXS(860.4,","AEMQNL","Select Data Field: ") Q:'OCXY  D EN^OCXOED11(OCXY)
 ;
 Q
 ;
EDMDD ;
 ;
 N OCXY F  W !! S OCXY=$$DIC("^OCXS(863.3,","AEMQNL","Select Link: ") Q:'OCXY  D EN^OCXOED13($P(OCXY,U,2))
 ;
 Q
 ;
COMP D ^OCXOCMP Q
 ;
SCANDF D SELECT^OCXOSCR1 Q
 ;
SCANEL D SELECT^OCXOSCR2 Q
 ;
EDPARAM(OCXD0,PARNAM) ;
 ;
 N NEWVAL
 W !!
 W "  ",$$FIELD("Link Parameter -> "_PARNAM_": ")
 W:$L($$GLPVAL(OCXD0,PARNAM)) $$GLPVAL(OCXD0,PARNAM)_" // "
 R NEWVAL:30 E  Q
 I (NEWVAL="@") W ! Q:'$$READ("Y","Are you sure you want to delete this value ?","YES")
 D SLPVAL(OCXD0,PARNAM,NEWVAL)
 Q
 ;
GLPVAL(OCXD0,PNAME) ;
 N X S X="" F  S X=$O(OCXRD("LINK",OCXD0,"PAR",X)) Q:'X  I ($G(OCXRD("LINK",OCXD0,"PAR",X,.01,"E"))=PNAME) Q
 Q:'X "" Q $G(OCXRD("LINK",OCXD0,"PAR",X,1,"E"))
 ;
SLPVAL(OCXD0,PNAME,PVAL) ;
 N DA,OCXY,OCXZ
 S DA(1)=OCXD0,OCXY=+$$DIC("^OCXS(863.3,"_OCXD0_",""PAR"",","ML","",PNAME,"","",.DA) Q:(OCXY<1)
 S DA(1)=OCXD0,DA=+OCXY,OCXZ=$$DIE("^OCXS(863.3,"_OCXD0_",""PAR"",",.DA,1,PVAL)
 Q
 ;
FIELD(OCXHDR) ;
 ;
 Q OCXTHLN_$G(OCXHDR)_OCXTNLN
 ;
DATA(OCXVAL,OCXLEN) ;
 ;
 N SPACES S SPACES="",$P(SPACES," ",OCXLEN+5)=" ",OCXVAL=$G(OCXVAL)
 I ($L(OCXVAL)>OCXLEN) Q $E(OCXVAL,1,OCXLEN-3)_"..."
 Q $E((OCXVAL_SPACES),1,OCXLEN)
 ;
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,OCXFLD,OCXVAL) ;
 ;
 N DUOUT,DTOUT,DIC
 S DR=OCXFLD_"///^S X=OCXVAL"
 S DIC=DIE D RM(IOM) D ^DIE D RM(0) Q:$G(DTOUT) 0 Q:$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