OCXOED11 ;SLC/RJS,CLA - Rule Editor (Data Field Display) ;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) ;
;
N OCXACT,OCXRD
F K OCXRD,OCXACT S (OCXRD,OCXACT)="" D DISP(OCXD0,.OCXRD,.OCXACT) Q:$$EN^OCXOED12(OCXD0,.OCXRD,.OCXACT)
;
Q
;
DISP(OCXD0,OCXRD,OCXACT) ;
;
N OCXTHLN,OCXTNLN,OCXTRLN,OCXTULN,OCXTNLN,OCXD1
;
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 OCXD1=0 D GETDATA(OCXD0,OCXD1,.OCXRD)
;
F S OCXD1=$O(^OCXS(860.4,OCXD0,"LINK",OCXD1)) Q:'OCXD1 D GETDATA(OCXD0,OCXD1,.OCXRD)
;
W @IOF,OCXTNLN
W !,$$CENTER($$FIELD("Data Field Edit Screen"),80),!!
W !," ",$$OPT^OCXOEDT("Edit","EDIT","12",.OCXACT,OCXD0)
W " ",$$FIELD("Data Field:")," ",$$DATA($G(OCXRD("DF",OCXD0,.01,"E")),50)
W !," ",$$FIELD("Abbrev:")," ",$$DATA($G(OCXRD("DF",OCXD0,1,"E")),50)
;
W !!,$$SEP("Meta Dictionary Links"),!
S OCXD1=0 F S OCXD1=$O(OCXRD("DF",OCXD0,"LINK",OCXD1)) Q:'OCXD1 D
.N OCXLINK,OCXCON,OCXAM
.S OCXLINK=$G(OCXRD("DF",OCXD0,"LINK",OCXD1,1,"E"))
.S OCXCON=$G(OCXRD("DF",OCXD0,"LINK",OCXD1,.01,"Z",.02,"E"))
.S OCXAM=$G(OCXRD("DF",OCXD0,"LINK",OCXD1,.01,"Z",1,"E"))
.W !!
.W " ",$$OPT^OCXOEDT("Link"_OCXD1,"EDLINK","12",.OCXACT,""""_OCXLINK_""","_OCXD1)
.W " ",$$FIELD("Link:")," ",$$DATA(OCXLINK_" ( "_OCXCON_" "_OCXAM_" )",50)
;
W !!
W " ",$$OPT^OCXOEDT("Add Link","LOPT","12",.OCXACT,"""ADD"","_OCXD0,"AL")
W " ",$$OPT^OCXOEDT("Delete Link","LOPT","12",.OCXACT,"""DEL"","_OCXD0,"DL")
;
Q
;
CENTER(X,M) ;
N SP S SP="",$P(SP," ",80)=" " Q $E(SP,1,((M\2)-($L(X)\2)))_X
;
SEP(OCXHDR) ;
;
N SPACES S SPACES="",$P(SPACES," ",80-$L(OCXHDR))=" " Q OCXTNLN_OCXTHLN_OCXTULN_$G(OCXHDR)_SPACES_OCXTNLN
;
FIELD(OCXHDR) ;
;
Q OCXTHLN_$G(OCXHDR)_OCXTNLN
;
DATA(OCXVAL,OCXLEN) ;
;
N SPACES S SPACES="",$P(SPACES," ",OCXLEN+5)=" ",OCXVAL=$G(OCXVAL)
I ($L(OCXVAL)>OCXLEN) Q $E(OCXVAL,1,OCXLEN-3)_"..."
Q $E((OCXVAL_SPACES),1,OCXLEN)
;
GETDATA(OCXD0,OCXD1,OCXD) ;
;
N OCXDIQ,OCXSRC,OCXX S OCXDIQ=""
;
I 'OCXD1 D DIQ("^OCXS(860.4,",OCXD0,"IEN",.OCXDIQ) M OCXD("DF")=OCXDIQ(860.4) Q
;
D DIQ("^OCXS(860.4,"_OCXD0_",""LINK"",",OCXD1,"IEN",.OCXDIQ) M OCXD("DF",OCXD0,"LINK")=OCXDIQ(860.41)
;
K OCXDIQ S OCXDIQ="" D DIQ("^OCXS(860.6,",OCXD1,"IEN",.OCXDIQ)
M OCXD("DF",OCXD0,"LINK",OCXD1,.01,"Z")=OCXDIQ(860.6,OCXD1) K OCXDIQ S OCXDIQ=""
;
Q
;
DIC(OCXDIC,OCXDIC0,OCXDICA,OCXX,OCXDICS,OCXDR) ;
;
N DIC,X,Y
S DIC=$G(OCXDIC) Q:'$L(DIC) -1
S DIC(0)=$G(OCXDIC0) S:$L($G(OCXX)) X=OCXX
S:$L($G(OCXDICS)) DIC("S")=OCXDICS
S:$L($G(OCXDICA)) DIC("A")=OCXDICA
S:$L($G(OCXDR)) DIC("DR")=OCXDR
D ^DIC Q:(Y<1) 0 Q Y
;
DIQ(DIC,DA,OCXDIQ0,OCXARY) ;
N DR,DIQ S DR=".01:99999",DIQ="OCXARY(",DIQ(0)=$G(OCXDIQ0) D EN^DIQ1
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOCXOED11 2923 printed Oct 16, 2024@18:26:01 Page 2
OCXOED11 ;SLC/RJS,CLA - Rule Editor (Data Field Display) ;10/29/98 12:37
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
+4 ;
S ;
+1 ;
+2 QUIT
EN(OCXD0) ;
+1 ;
+2 NEW OCXACT,OCXRD
+3 FOR
KILL OCXRD,OCXACT
SET (OCXRD,OCXACT)=""
DO DISP(OCXD0,.OCXRD,.OCXACT)
if $$EN^OCXOED12(OCXD0,.OCXRD,.OCXACT)
QUIT
+4 ;
+5 QUIT
+6 ;
DISP(OCXD0,OCXRD,OCXACT) ;
+1 ;
+2 NEW OCXTHLN,OCXTNLN,OCXTRLN,OCXTULN,OCXTNLN,OCXD1
+3 ;
+4 SET OCXTNLN=$CHAR(27,91,48,109)
SET OCXTRLN=$CHAR(27,91,55,109)
SET OCXTULN=$CHAR(27,91,52,109)
SET OCXTHLN=$CHAR(27,91,49,109)
+5 ;
+6 SET OCXD1=0
DO GETDATA(OCXD0,OCXD1,.OCXRD)
+7 ;
+8 FOR
SET OCXD1=$ORDER(^OCXS(860.4,OCXD0,"LINK",OCXD1))
if 'OCXD1
QUIT
DO GETDATA(OCXD0,OCXD1,.OCXRD)
+9 ;
+10 WRITE @IOF,OCXTNLN
+11 WRITE !,$$CENTER($$FIELD("Data Field Edit Screen"),80),!!
+12 WRITE !," ",$$OPT^OCXOEDT("Edit","EDIT","12",.OCXACT,OCXD0)
+13 WRITE " ",$$FIELD("Data Field:")," ",$$DATA($GET(OCXRD("DF",OCXD0,.01,"E")),50)
+14 WRITE !," ",$$FIELD("Abbrev:")," ",$$DATA($GET(OCXRD("DF",OCXD0,1,"E")),50)
+15 ;
+16 WRITE !!,$$SEP("Meta Dictionary Links"),!
+17 SET OCXD1=0
FOR
SET OCXD1=$ORDER(OCXRD("DF",OCXD0,"LINK",OCXD1))
if 'OCXD1
QUIT
Begin DoDot:1
+18 NEW OCXLINK,OCXCON,OCXAM
+19 SET OCXLINK=$GET(OCXRD("DF",OCXD0,"LINK",OCXD1,1,"E"))
+20 SET OCXCON=$GET(OCXRD("DF",OCXD0,"LINK",OCXD1,.01,"Z",.02,"E"))
+21 SET OCXAM=$GET(OCXRD("DF",OCXD0,"LINK",OCXD1,.01,"Z",1,"E"))
+22 WRITE !!
+23 WRITE " ",$$OPT^OCXOEDT("Link"_OCXD1,"EDLINK","12",.OCXACT,""""_OCXLINK_""","_OCXD1)
+24 WRITE " ",$$FIELD("Link:")," ",$$DATA(OCXLINK_" ( "_OCXCON_" "_OCXAM_" )",50)
End DoDot:1
+25 ;
+26 WRITE !!
+27 WRITE " ",$$OPT^OCXOEDT("Add Link","LOPT","12",.OCXACT,"""ADD"","_OCXD0,"AL")
+28 WRITE " ",$$OPT^OCXOEDT("Delete Link","LOPT","12",.OCXACT,"""DEL"","_OCXD0,"DL")
+29 ;
+30 QUIT
+31 ;
CENTER(X,M) ;
+1 NEW SP
SET SP=""
SET $PIECE(SP," ",80)=" "
QUIT $EXTRACT(SP,1,((M\2)-($LENGTH(X)\2)))_X
+2 ;
SEP(OCXHDR) ;
+1 ;
+2 NEW SPACES
SET SPACES=""
SET $PIECE(SPACES," ",80-$LENGTH(OCXHDR))=" "
QUIT OCXTNLN_OCXTHLN_OCXTULN_$GET(OCXHDR)_SPACES_OCXTNLN
+3 ;
FIELD(OCXHDR) ;
+1 ;
+2 QUIT OCXTHLN_$GET(OCXHDR)_OCXTNLN
+3 ;
DATA(OCXVAL,OCXLEN) ;
+1 ;
+2 NEW SPACES
SET SPACES=""
SET $PIECE(SPACES," ",OCXLEN+5)=" "
SET OCXVAL=$GET(OCXVAL)
+3 IF ($LENGTH(OCXVAL)>OCXLEN)
QUIT $EXTRACT(OCXVAL,1,OCXLEN-3)_"..."
+4 QUIT $EXTRACT((OCXVAL_SPACES),1,OCXLEN)
+5 ;
GETDATA(OCXD0,OCXD1,OCXD) ;
+1 ;
+2 NEW OCXDIQ,OCXSRC,OCXX
SET OCXDIQ=""
+3 ;
+4 IF 'OCXD1
DO DIQ("^OCXS(860.4,",OCXD0,"IEN",.OCXDIQ)
MERGE OCXD("DF")=OCXDIQ(860.4)
QUIT
+5 ;
+6 DO DIQ("^OCXS(860.4,"_OCXD0_",""LINK"",",OCXD1,"IEN",.OCXDIQ)
MERGE OCXD("DF",OCXD0,"LINK")=OCXDIQ(860.41)
+7 ;
+8 KILL OCXDIQ
SET OCXDIQ=""
DO DIQ("^OCXS(860.6,",OCXD1,"IEN",.OCXDIQ)
+9 MERGE OCXD("DF",OCXD0,"LINK",OCXD1,.01,"Z")=OCXDIQ(860.6,OCXD1)
KILL OCXDIQ
SET OCXDIQ=""
+10 ;
+11 QUIT
+12 ;
DIC(OCXDIC,OCXDIC0,OCXDICA,OCXX,OCXDICS,OCXDR) ;
+1 ;
+2 NEW DIC,X,Y
+3 SET DIC=$GET(OCXDIC)
if '$LENGTH(DIC)
QUIT -1
+4 SET DIC(0)=$GET(OCXDIC0)
if $LENGTH($GET(OCXX))
SET X=OCXX
+5 if $LENGTH($GET(OCXDICS))
SET DIC("S")=OCXDICS
+6 if $LENGTH($GET(OCXDICA))
SET DIC("A")=OCXDICA
+7 if $LENGTH($GET(OCXDR))
SET DIC("DR")=OCXDR
+8 DO ^DIC
if (Y<1)
QUIT 0
QUIT Y
+9 ;
DIQ(DIC,DA,OCXDIQ0,OCXARY) ;
+1 NEW DR,DIQ
SET DR=".01:99999"
SET DIQ="OCXARY("
SET DIQ(0)=$GET(OCXDIQ0)
DO EN^DIQ1
+2 QUIT
+3 ;