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

ORY423ES.m

Go to the documentation of this file.
  1. ORY423ES ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*423) ;JUN 29,2016 at 06:15
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**423**;Dec 17,1997;Build 19
  1. ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
  1. ;
  1. S ;
  1. ;
  1. N OCXDIER,QUIT,LINE,TEXT,REMOTE,LOCAL,D0,OPCODE,REF,OCXFLAG S QUIT=0
  1. N OCXAUTO,OCZSCR
  1. ;
  1. D DOT
  1. I $L($T(VERSION^OCXOCMP)),($$VERSION^OCXOCMP="ORDER CHECK EXPERT version 1.01 released OCT 29,1998"),1
  1. E D Q
  1. .W !
  1. .W !,"Rule Transport aborted, version mismatch."
  1. .W !,"Current Local version: ",$$VERSION^OCXOCMP
  1. .W !," Rule Transport Version: ORDER CHECK EXPERT version 1.01 released OCT 29,1998"
  1. I '$D(DTIME) W !!,"DTIME not defined !!",!! Q
  1. W !!,"Order Check Expert System Rule Transporter"
  1. W !," Created: JUN 29,2016 at 06:15 at CPRS30.FO-SLC.DOMAIN.EXT"
  1. W !," Current Date: ",$$NOW^ORY4230," at ",$$NETNAME^OCXSEND,!!
  1. S LASTFILE=0 K ^TMP("OCXRULE",$J)
  1. S ^TMP("OCXRULE",$J)=($P($H,",",2)+($H*86400)+(1*60*60))_" <- ^TMP ENTRY EXPIRATION DATE FOR ^OCXOPURG"
  1. S OCXFLAG="O"
  1. ;
  1. RUN ;
  1. ;
  1. W !,"Loading Data " D ^ORY42301
  1. ;
  1. S LINE=0 F S LINE=$O(^TMP("OCXRULE",$J,LINE)) Q:'LINE D Q:QUIT
  1. .D:'(LINE#50) STATUS^OCXOPOST(LINE,$O(^TMP("OCXRULE",$J," "),-1))
  1. .S TEXT=$G(^TMP("OCXRULE",$J,LINE)) I $L(TEXT) D Q:QUIT
  1. ..S TEXT=$P(TEXT,";",2,999),OPCODE=$P(TEXT,U,1),TEXT=$P(TEXT,U,2,999)
  1. ..;
  1. ..I OPCODE="KEY" D DOT S LOCAL="",D0=$$GETFILE^ORY4230(+$P(TEXT,U,1),$P(TEXT,U,2),.LOCAL) S QUIT=(D0=(-10)) Q
  1. ..I OPCODE="R" S REF="REMOTE("_$P(TEXT,":",1)_":"_D0_$P(TEXT,":",2,99)_")" Q
  1. ..I OPCODE="D",$D(REF) S @REF=$P(TEXT,U,1,999) K REF Q
  1. ..;
  1. ..I OPCODE="EOR" S QUIT=$$COMPARE^ORY4231(.LOCAL,.REMOTE) K LOCAL,REMOTE Q
  1. ..I OPCODE="EOF" K LOCAL,REMOTE Q
  1. ..I OPCODE="SOF" W !," Installing '",TEXT,"' records... " Q
  1. ..I OPCODE="ROOT" D Q
  1. ...N FILE,DATA
  1. ...S FILE=U_$P(TEXT,U,1),DATA=$P(TEXT,U,2,3)
  1. ...I ($P($G(@FILE),U,1,2)=DATA) Q
  1. ...S $P(@FILE,U,1,2)=DATA
  1. ...W !," Restoring file #",(+$P(DATA,U,2))," zero node"
  1. ..;
  1. ..W !,"Unknown OpCode: ",OPCODE," in: ",TEXT S QUIT=$$PAUSE^ORY4230 W !
  1. ;
  1. K ^TMP("OCXRULE",$J)
  1. ;
  1. I $D(^OCXS) D
  1. .N FILE,DO,PD0,CNT
  1. .S FILE=0 F S FILE=$O(^OCXS(FILE)) Q:'FILE D
  1. ..S D0=0 F CNT=0:1 S PD0=D0,D0=$O(^OCXS(FILE,D0)) Q:'D0
  1. ..S $P(^OCXS(FILE,0),U,3,4)=CNT_U_PD0
  1. ;
  1. I $G(OCXDIER) D
  1. .W !!!!!!!
  1. .W !,?5,"******************** Warning ******************** "
  1. .W !,?7,+$G(OCXDIER)," data filing error",$S(($G(OCXDIER)=1):"",1:"s"),"."
  1. .W !,?7,"Some expert system rules may be incomplete."
  1. .W !,?5,"******************** Warning ******************** "
  1. I '$G(OCXDIER) W !!,?5," No data filing errors."
  1. W !!,"Transport Finished..."
  1. ;
  1. D
  1. .N OCXOETIM
  1. .D BMES^XPDUTL("---Creating Order Check Routines-----------------------------------")
  1. .D AUTO^OCXOCMP
  1. ;
  1. Q
  1. ;
  1. DOT Q:$G(OCXAUTO) W:($X>70) ! W " ." Q
  1. ;
  1. READ(OCXZ0,OCXZA,OCXZB,OCXZL) ;
  1. N OCXLINE,DIR,DTOUT,DUOUT,DIRUT,DIROUT
  1. Q:'$L($G(OCXZ0)) U
  1. S DIR(0)=OCXZ0
  1. S:$L($G(OCXZA)) DIR("A")=OCXZA
  1. S:$L($G(OCXZB)) DIR("B")=OCXZB
  1. F OCXLINE=1:1:($G(OCXZL)-1) W !
  1. D ^DIR
  1. I $D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT) Q U
  1. Q Y
  1. ;