ORY240 ;SLC/JMH - Post Install for OR*3*240 ; [9/2/05 1:25pm]
;;3.0;ORDER ENTRY/RESULTS REPORTING;**240**;Dec 17, 1997
POST ;
N RADA ;Procedure IEN
S RADA=0 F S RADA=$O(^RAMIS(71,RADA)) Q:'RADA D
.N CM,OIDA
.S OIDA=$O(^ORD(101.43,"ID",RADA_";99RAP",0))
.Q:'$G(OIDA)
.S CM=$$GETCM(RADA)
.I $D(^RAMIS(71,RADA,4)) D
..N CHDA ;child IEN
..S CHDA=0 F S CHDA=$O(^RAMIS(71,RADA,4,"B",CHDA)) Q:'$G(CHDA) S CM=$$MERGECM($G(CM),$$GETCM(CHDA))
.I $L($G(CM)) S $P(^ORD(101.43,OIDA,"RA"),U)=CM
Q
GETCM(RADA) ;
N I,CM
S CM=""
S I=0 F S I=$O(^RAMIS(71,RADA,"CM",I)) Q:'I S CM=$G(CM)_$G(^RAMIS(71,RADA,"CM",I,0))
Q CM
MERGECM(X,Y) ;
N I,RET,ARRY
S RET=""
I $L(X) F I=1:1:$L(X) S ARRY($E(X,I))=""
I $L(Y) F I=1:1:$L(Y) S ARRY($E(Y,I))=""
S I="" F S I=$O(ARRY(I)) Q:I="" S RET=RET_I
Q RET
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORY240 827 printed Oct 16, 2024@18:40:24 Page 2
ORY240 ;SLC/JMH - Post Install for OR*3*240 ; [9/2/05 1:25pm]
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**240**;Dec 17, 1997
POST ;
+1 ;Procedure IEN
NEW RADA
+2 SET RADA=0
FOR
SET RADA=$ORDER(^RAMIS(71,RADA))
if 'RADA
QUIT
Begin DoDot:1
+3 NEW CM,OIDA
+4 SET OIDA=$ORDER(^ORD(101.43,"ID",RADA_";99RAP",0))
+5 if '$GET(OIDA)
QUIT
+6 SET CM=$$GETCM(RADA)
+7 IF $DATA(^RAMIS(71,RADA,4))
Begin DoDot:2
+8 ;child IEN
NEW CHDA
+9 SET CHDA=0
FOR
SET CHDA=$ORDER(^RAMIS(71,RADA,4,"B",CHDA))
if '$GET(CHDA)
QUIT
SET CM=$$MERGECM($GET(CM),$$GETCM(CHDA))
End DoDot:2
+10 IF $LENGTH($GET(CM))
SET $PIECE(^ORD(101.43,OIDA,"RA"),U)=CM
End DoDot:1
+11 QUIT
GETCM(RADA) ;
+1 NEW I,CM
+2 SET CM=""
+3 SET I=0
FOR
SET I=$ORDER(^RAMIS(71,RADA,"CM",I))
if 'I
QUIT
SET CM=$GET(CM)_$GET(^RAMIS(71,RADA,"CM",I,0))
+4 QUIT CM
MERGECM(X,Y) ;
+1 NEW I,RET,ARRY
+2 SET RET=""
+3 IF $LENGTH(X)
FOR I=1:1:$LENGTH(X)
SET ARRY($EXTRACT(X,I))=""
+4 IF $LENGTH(Y)
FOR I=1:1:$LENGTH(Y)
SET ARRY($EXTRACT(Y,I))=""
+5 SET I=""
FOR
SET I=$ORDER(ARRY(I))
if I=""
QUIT
SET RET=RET_I
+6 QUIT RET