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

ORY2211.m

Go to the documentation of this file.
  1. ORY2211 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*221) ;AUG 30,2005 at 11:41
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**221**;Dec 17,1997
  1. ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
  1. ;
  1. S ;
  1. ;
  1. Q
  1. ;
  1. ;
  1. COMPARE(L,R) ;
  1. ;
  1. Q:$$RES("R") 1
  1. ;
  1. Q:'$L($O(L(""))) $$ADDREC^ORY2212("R")
  1. ;
  1. N C,OCXDD M C=L,C=R S OCXDD=$O(C("")) Q $$MULT("C",OCXDD)
  1. ;
  1. Q 0
  1. ;
  1. RES(REF) ;
  1. ;
  1. N QUIT,SUB
  1. S QUIT=0
  1. S SUB="" F S SUB=$O(@REF@(SUB)) Q:'$L(SUB) I (SUB[":") D Q:QUIT
  1. .N DD,DA
  1. .S DD=$P(SUB,":",1),DA=$P(SUB,":",2)
  1. .I $L(DA),'(DA=+DA) D Q:QUIT
  1. ..N DANEW,SUBNEW
  1. ..S DANEW=$O(^OCXS($P(DA,U,2),"B",$P(DA,U,1),0))
  1. ..I 'DANEW W !!,$P($G(^OCXS(+$P(DA,U,2),0)),U,1),": ",$P(DA,U,1)," could not resolve name.",!!," End Transport." S QUIT=1 Q
  1. ..S SUBNEW=DD_":"_DANEW
  1. ..I $D(@REF@(SUBNEW)) W !!," multiple #",DANEW," already existed." S QUIT=1 Q
  1. ..M @REF@(SUBNEW)=@REF@(SUB)
  1. ..K @REF@(SUB)
  1. ..S SUB=""
  1. .I $L(SUB),($D(@REF@(SUB))>9) S QUIT=$$RES($NA(@REF@(SUB)))
  1. ;
  1. Q QUIT
  1. ;
  1. MULT(CREF,OCXDD) ;
  1. ;
  1. N OCXSUB,LREF,RREF,QUIT,OCXFLD
  1. S LREF="L"_$E(CREF,2,$L(CREF)),RREF="R"_$E(CREF,2,$L(CREF))
  1. ;
  1. S QUIT=0,OCXFLD="" F S OCXFLD=$O(@CREF@(OCXDD,OCXFLD)) Q:'$L(OCXFLD) D Q:QUIT
  1. .I (OCXFLD[":") D Q:QUIT
  1. ..Q:$$EXFLD(+OCXFLD,0)
  1. ..I '$D(@LREF@(OCXDD,OCXFLD,.01,"E")) D M @LREF@(OCXDD,OCXFLD)=@RREF@(OCXDD,OCXFLD)
  1. ...D WARN("Missing multiple:",CREF,OCXDD,OCXFLD)
  1. ...S QUIT=$$ADDMULT^ORY2213(CREF,OCXDD,OCXFLD)
  1. ..I '$D(@RREF@(OCXDD,OCXFLD,.01,"E")) D M @RREF@(OCXDD,OCXFLD)=@LREF@(OCXDD,OCXFLD)
  1. ...D WARN("Extra multiple:",CREF,OCXDD,OCXFLD)
  1. ...S QUIT=$$DELMULT^ORY2213($$APPEND(CREF,OCXDD),OCXFLD)
  1. .;
  1. .I (OCXFLD=+OCXFLD),'$$EXFLD(+OCXDD,OCXFLD) D
  1. ..I ($O(@CREF@(OCXDD,OCXFLD,""))="E") D Q
  1. ...I $L($G(@RREF@(OCXDD,OCXFLD,"E"))),'$L($G(@LREF@(OCXDD,OCXFLD,"E"))) D Q
  1. ....D WARN("Data Value Missing in "_$$NETNAME^OCXSEND,CREF,OCXDD,OCXFLD,"E")
  1. ....S QUIT=$$EDITFLD^ORY2214(CREF,OCXDD,OCXFLD,"E")
  1. ...I $L($G(@LREF@(OCXDD,OCXFLD,"E"))),'$L($G(@RREF@(OCXDD,OCXFLD,"E"))) D Q
  1. ....D WARN("Extra Data Value in "_$$NETNAME^OCXSEND,CREF,OCXDD,OCXFLD,"E")
  1. ....S QUIT=$$DELFLD^ORY2214(CREF,OCXDD,OCXFLD,"E")
  1. ...I '(@LREF@(OCXDD,OCXFLD,"E")=@RREF@(OCXDD,OCXFLD,"E")) D
  1. ....D WARN("Inconsistent Data",CREF,OCXDD,OCXFLD,"E")
  1. ....S QUIT=$$EDITFLD^ORY2214(CREF,OCXDD,OCXFLD,"E")
  1. ..S OCXSUB=0 F Q:QUIT S OCXSUB=$O(@CREF@(OCXDD,OCXFLD,OCXSUB)) Q:'OCXSUB I '($G(@RREF@(OCXDD,OCXFLD,OCXSUB))=$G(@LREF@(OCXDD,OCXFLD,OCXSUB))) D Q
  1. ...D WARN("Inconsistent word Data",CREF,OCXDD,OCXFLD,OCXSUB)
  1. ...S QUIT=$$LOADWORD^ORY2212(RREF,OCXDD,OCXFLD,OCXSUB)
  1. .;
  1. .I 'QUIT,(OCXFLD[":") S QUIT=$$MULT($$APPEND(CREF,OCXDD),OCXFLD)
  1. Q QUIT
  1. ;
  1. APPEND(ARRAY,OCXSUB) ;
  1. S:'(OCXSUB=+OCXSUB) OCXSUB=""""_OCXSUB_""""
  1. Q:'(ARRAY["(") ARRAY_"("_OCXSUB_")"
  1. Q $E(ARRAY,1,$L(ARRAY)-1)_","_OCXSUB_")"
  1. ;
  1. EXFLD(FILE,OCXFLD) ;
  1. N OCXFNAM
  1. S OCXFNAM=$$FIELD^OCXSENDD(FILE,OCXFLD,"LABEL")
  1. I (OCXFNAM["UNIQUE OBJECT IDENTIFIER") Q 1
  1. I (FILE=860.2),(OCXFLD=.02) Q 1
  1. I (FILE=860.22),(OCXFLD=4) Q 1
  1. I (FILE=860.3),(OCXFLD=3) Q 1
  1. I (FILE=860.9),(OCXFLD=1) Q 1
  1. I (FILE=860.91) Q 1
  1. I (FILE=860.801) Q 1
  1. I (FILE=860.81) Q 1
  1. I (FILE=861.01) Q 1
  1. I (FILE=863.02) Q 1
  1. I (FILE=863.54) Q 1
  1. I (FILE=863.61) Q 1
  1. I (FILE=863.72) Q 1
  1. I (FILE=863.81) Q 1
  1. I ($E(OCXFNAM,1)="*") Q 1
  1. Q 0
  1. ;
  1. WARN(MSG,CREF,OCXDD,OCXFLD,OCXSUB) ;
  1. ;
  1. Q:$G(OCXAUTO)
  1. ;
  1. N D0,DASH,OCXDDPTH,OCXDPTR,FILE,FILEID,LREF,OCXPTR,RREF
  1. ;
  1. S DASH="",$P(DASH,"-",(55-$L(MSG)))="-"
  1. W !!,"------------",MSG,DASH
  1. D DSPHDR(CREF,OCXDD,OCXFLD)
  1. I $D(OCXSUB) D DSPFLD(CREF,OCXDD,OCXFLD,OCXSUB)
  1. I '$D(OCXSUB) D DSPREC(CREF,OCXDD,OCXFLD)
  1. ;
  1. W ! Q
  1. ;
  1. DSPREC(CREF,OCXDD,OCXFLD) ;
  1. ;
  1. N OCXDPTR,OCXDDPTH,LEVL,OCXCREF,OCXSUB
  1. S OCXCREF=$$APPEND($$APPEND(CREF,OCXDD),OCXFLD)
  1. S OCXDDPTH=$P($P(OCXCREF,"(",2),")",1),LEVL=$L(OCXDDPTH,",")
  1. S OCXSUB="" F S OCXSUB=$O(@OCXCREF@(OCXSUB)) Q:'$L(OCXSUB) D
  1. .;
  1. .I '(OCXSUB[":"),'((OCXSUB=.01)&$O(@OCXCREF@(OCXSUB))) D
  1. ..N LINE
  1. ..Q:$$EXFLD(+OCXFLD,OCXSUB)
  1. ..I OCXFLD W !,?(5+((LEVL)*4)),$$FIELD^OCXSENDD(+OCXFLD,OCXSUB,"LABEL"),": ",$G(@OCXCREF@(OCXSUB,"E"))
  1. ..S LINE=0 F S LINE=$O(@OCXCREF@(OCXSUB,LINE)) Q:'LINE D
  1. ...W !,?(5+(LEVL*4)),$J(LINE,3),">",@OCXCREF@(OCXSUB,LINE)
  1. .;
  1. .I (OCXSUB[":") D
  1. ..N D0,OCXDD,FILENAME
  1. ..S D0=+$P(OCXSUB,":",2),OCXDD=+OCXSUB
  1. ..S FILENAME=$$FILENAME^OCXSENDD(OCXDD)
  1. ..I $L(FILENAME) W !,?(5+($L(LEVL)*4)),FILENAME
  1. ..E W !!,?(5+(LEVL*4)),FILENAME
  1. ..W " ",D0,": ",$G(@OCXCREF@(OCXSUB,.01,"E"))
  1. ..D DSPREC($$APPEND(CREF,OCXDD),OCXFLD,OCXSUB)
  1. ;
  1. Q
  1. ;
  1. DSPHDR(CREF,OCXDD,OCXFLD) ;
  1. ;
  1. N D0,FILE,FILEID,OCXPTR,OCXDDPTH
  1. S OCXDDPTH=$P($P($$APPEND($$APPEND(CREF,OCXDD),OCXFLD),"(",2),")",1)
  1. S FILE="" F OCXPTR=1:1:$L(OCXDDPTH,",") D
  1. .N OCXDD,D0,FILEID
  1. .S FILEID=$P(OCXDDPTH,",",OCXPTR)
  1. .I (FILEID[":") D
  1. ..S D0=+$P(FILEID,":",2),OCXDD=+$E(FILEID,2,$L(FILEID))
  1. ..W !,?(5+(OCXPTR*4)),$$FILENAME^OCXSENDD(OCXDD)
  1. ..S:$L(FILE) FILE=FILE_"," S FILE=FILE_FILEID
  1. ..I $D(@("L("_FILE_",.01,""E"")")) W ": ",@("L("_FILE_",.01,""E"")") W:D0 " [",D0,"]"
  1. ..E I $D(@("R("_FILE_",.01,""E"")")) W ": ",@("R("_FILE_",.01,""E"")") W:D0 " [",D0,"]"
  1. ;
  1. Q
  1. ;
  1. DSPFLD(CREF,OCXDD,OCXFLD,OCXSUB) ;
  1. ;
  1. N OCXDPTR,LREF,RREF,OCXDDPTH
  1. ;
  1. S OCXDDPTH=$P($P($$APPEND(CREF,OCXDD),"(",2),")",1)
  1. S LREF="L("_OCXDDPTH_")",RREF="R("_OCXDDPTH_")"
  1. W !,?(5+(($L(OCXDDPTH,",")+1)*4)),$$FIELD^OCXSENDD(OCXDD,OCXFLD,"LABEL")," field [",OCXFLD,"]"
  1. I OCXSUB W " Line #",OCXSUB
  1. ;
  1. W:($D(@RREF@(OCXFLD,OCXSUB))) !,?(5+(($L(OCXDDPTH,",")+2)*4)),"(R) DEVCUR.FO-SLC.DOMAIN.EXT: ",@RREF@(OCXFLD,OCXSUB)
  1. W:($D(@LREF@(OCXFLD,OCXSUB))) !,?(5+(($L(OCXDDPTH,",")+2)*4)),"(L) ",$$NETNAME^OCXSEND,": ",@LREF@(OCXFLD,OCXSUB)
  1. ;
  1. Q
  1. ;
  1. W !,?10 Q 0 Q $$PAUSE
  1. ;
  1. PAUSE() W " Press Enter " R X:DTIME W ! Q (X[U)
  1. ;
  1. NOW() N X,Y,%DT S X="N",%DT="T" D ^%DT S Y=$$DATE^OCXSENDD(Y) S:(Y["@") Y=$P(Y,"@",1)_" at "_$P(Y,"@",2) Q Y
  1. ;