source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORGUEM1.m@ 1383

Last change on this file since 1383 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.7 KB
Line 
1ORGUEM1 ; slc/KCM - Build menu in seq #, name format ;2/5/92 17:16;
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
3SET(DA) ;From: ORGUEM Entry: DA Exit: DA
4 I $L($G(^ORD(101,DA,99))),$P($G(^(99)),"^")=$P($G(^XUTL("XQORM",DA_";"_$J,0)),"^") Q
5 N ORCOL,ORCCOL,ORROW,ORCROW,ORPOS,ORTOT,S1,S2,X,X1
6 K ^TMP("XQORM",$J) D KILL
7 S ORCOL=1 I $P($G(^ORD(101,DA,4)),"^")>0 S ORCOL=80\$P(^(4),"^",1)
8 S ^XUTL("XQORM",DA_";"_$J,"COL")=ORCOL,(ORTOT,S2)=0
9 F S S2=$O(^ORD(101,DA,10,S2)) Q:S2'>0 D
10 . S X=^ORD(101,DA,10,S2,0)
11 . S X=$S(+$P(X,"^",3):+$P(X,"^",3),+$P(X,"^",2):+$P(X,"^",2),$L($P(X,"^",2)):"M"_$P(X,"^",2),1:"Z"_$P(^ORD(101,+X,0),"^",2))
12 . S ^TMP("XQORM",$J,X,S2)="",ORTOT=ORTOT+1
13 S ORROW=ORTOT\ORCOL+$S(ORTOT#ORCOL:1,1:0),ORCCOL=1,ORCROW=0,S1=""
14 F S S1=$O(^TMP("XQORM",$J,S1)) Q:S1="" S S2=0 D ;S1 is sequence (#,M_,Z_)
15 . F S S2=$O(^TMP("XQORM",$J,S1,S2)) Q:S2'>0 D ;S2 is IEN of item multiple
16 . . S X=^ORD(101,DA,10,S2,0) ;X is the item node
17 . . I '$D(^ORD(101,+X,0)) K ^ORD(101,DA,10,S2),^("B",+X,S2) S $P(^ORD(101,DA,10,0),"^",3,4)=S2_"^"_($P(^ORD(101,DA,10,0),"^",4)-1) Q
18 . . S ORCROW=ORCROW+1 I ORCROW>ORROW S ORCROW=1,ORCCOL=ORCCOL+1
19 . . S ORPOS=ORCROW+(ORCCOL/10) D
20 . . . S X1=$TR($P(^ORD(101,+X,0),"^"),",=;-"," ") Q:'$L(X1)
21 . . . S ^XUTL("XQORM",DA_";"_$J,ORPOS,0)=S2_"^"_+X_"^"_$E(X1,1,80\ORCOL-5)_"^"_$P(X,"^",3)
22 . . . S ^XUTL("XQORM",DA_";"_$J,"B",$$UP(X1),ORPOS)=""
23 . . . I $L($P(X,"^",3)) S ^XUTL("XQORM",DA_";"_$J,"B",$$UP($P(X,"^",3)),ORPOS)=1
24 S ^XUTL("XQORM",DA_";"_$J,0)=$G(^ORD(101,DA,99))
25 K ^TMP("XQORM",$J)
26 Q
27UP(X) ;Convert X to upper case
28 Q $TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
29KILL ;From: File 101, Field 99 Entry: DA Exit: DA
30 K ^XUTL("XQORM",DA_";"_$J)
31 Q
Note: See TracBrowser for help on using the repository browser.