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

OCXOED14.m

Go to the documentation of this file.
OCXOED14 ;SLC/RJS,CLA - Rule Editor (Meta Dictionary Link Options) ;10/29/98  12:37
 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;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(863.3,OCXD0)) 1
 ;
 Q 0
 ;
EDATT(OCXD0) ;
 ;
 N OCXX
 S OCXX=$$MDIE("^OCXS(863.3,",OCXD0,".05")
 Q
 ;
EDPARAM(OCXD0,PARNAM) ;
 ;
 N NEWVAL,OLDVAL
 S OLDVAL=$$GLPVAL(OCXD0,PARNAM)
 W !!
 W "  ",$$FIELD("Link Parameter -> "_PARNAM_": ")
 W !!,"-> " W:$L(OLDVAL) OLDVAL_" // "
 W !,"-> "
 R NEWVAL:DTIME E  Q
 I '$L(NEWVAL) S NEWVAL=$$SCREEN^OCXOED12(OLDVAL) D:'(NEWVAL=OLDVAL) SLPVAL(OCXD0,PARNAM,NEWVAL) Q
 I (NEWVAL="@") W ! Q:'$$READ("Y","Are you sure you want to delete this value ?","YES")
 S:(NEWVAL["|") NEWVAL=$$SCREEN^OCXOED12(NEWVAL) D SLPVAL(OCXD0,PARNAM,NEWVAL)
 Q
 ;
EDPATT(OCXD0,PNAME) ;
 ;
 N OLDVAL,NEWVAL,OCXX,OCXY,OCXZ,DA,OCXPR
 ;
 S OLDVAL="",OCXX="" F  S OCXX=$O(OCXRD("ATT",OCXD0,"PAR",OCXX)) Q:'OCXX  I ($G(OCXRD("ATT",OCXD0,"PAR",OCXX,.01,"E"))=PNAME) Q
 S:OCXX OLDVAL=$G(OCXRD("ATT",OCXD0,"PAR",OCXX,1,"E"))
 ;
 W !!
 S OCXPR=$$FIELD("Attribute Parameter -> "_PNAME_": ") S:$L(OLDVAL) OCXPR=OCXPR_OLDVAL_" // "
 S NEWVAL=$$DIC("^OCXS(864.1,","AEMQ",OCXPR)
 ;
 S:'$D(^OCXS(863.4,OCXD0,"PAR",0)) ^OCXS(863.4,OCXD0,"PAR",0)="^863.41PI^^"
 S DA(1)=OCXD0,OCXY=+$$DIC("^OCXS(863.4,"_OCXD0_",""PAR"",","ML","",PNAME,"","",.DA) Q:(OCXY<1)
 S DA(1)=OCXD0,DA=+OCXY,OCXZ=$$DIE("^OCXS(863.4,"_OCXD0_",""PAR"",",.DA,1,$P(NEWVAL,U,2))
 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:'$D(^OCXS(863.4,OCXD0,"PAR",0)) ^OCXS(863.3,OCXD0,"PAR",0)="^863.32P^^"
 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(OC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