ORWRP2 ; dcm/slc - Health Summary adhoc RPC's
;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,109**;Dec 17, 1997
COMP(ORY) ;Get ADHOC sub components (FILE 142.1)
;RPC => ORWRP2 HS COMPONENTS
;Y(i)=(1)I;IFN^(2)Component Name [Abb]^(3)Occ Limit^(4)Time Limit^(5)Header Name^
; (6)Hosp Loc Disp^(7)ICD Text Disp^(8)Prov Narr Disp^(9)Summary Order
D COMP^GMTSADH5(.ORY)
Q
;
COMPABV(ORY) ;Get ADHOD sub components listed by Abbreviation
N I,X,X1,X2,X3
D COMP^GMTSADH5(.ORY)
S I=0
F S I=$O(ORY(I)) Q:'I S X=ORY(I) D
. S X1=$P($P(X,"^",2),"["),X1=$E(X1,1,$L(X1)-1),X2=$P($P(X,"^",2),"[",2),X2=$E(X2,1,$L(X2)-1)
. ;S X3=X2_" - "_X1_" ",$P(ORY(I),"^",2)=X3
. S X3=X2_" - "_$P(X,"^",5)_" ",$P(ORY(I),"^",2)=X3
Q
COMPDISP(ORY) ;Get ADHOD sub components listed by Display Name
N I,X,X1,X2,X3
D COMP^GMTSADH5(.ORY)
S I=0
F S I=$O(ORY(I)) Q:'I S X=ORY(I) D
. S X1=$P($P(X,"^",2),"["),X1=$E(X1,1,$L(X1)-1),X2=$P($P(X,"^",2),"[",2),X2=$E(X2,1,$L(X2)-1)
. S X3=$P(X,"^",5)_" ["_X2_"]",$P(ORY(I),"^",2)=X3
Q
COMPSUB(ORY,ORSUB) ;Get subitems from a predefined Adhoc component
I '$L($T(COMPSUB^GMTSADH5)) Q
D COMPSUB^GMTSADH5(.ORY,ORSUB)
Q
;
SAVLKUP(OK,VAL) ;save Adhoc lookup selection
N ORERR
S OK=""
D EN^XPAR(DUZ_";VA(200,","ORWRP ADHOC LOOKUP",1,VAL,.ORERR)
I ORERR S OK=VAL_":"_ORERR
Q
GETLKUP(ORY) ;Get Adhoc lookup selection
S ORY=$$GET^XPAR("ALL","ORWRP ADHOC LOOKUP",1,"I")
Q
FILES(ORY,ORCOMP) ;Get Files to select from for a component
;RPC => ORWRP2 HS COMP FILES
D FILES^GMTSADH5(.ORY,ORCOMP)
Q
;
FILESEL(OROOT,ORFILE,ORFROM,ORDIR) ;Get file entries for Combobox
;RPC => ORWRP2 HS FILE LOOKUP
D FILESEL^GMTSADH5(.OROOT,ORFILE,ORFROM,ORDIR)
Q
;
REPORT(OROOT,ORCOMPS,ORDFN) ;Build Report from array of Components passed in COMPS
;RPC => ORWRP2 HS REPORT TEXT
;ORCOMPS(i)=array of subcomponents chosen, value is pointer at ^GMT(142,DA(1),1,DA)
Q:'$G(ORDFN)
N GMTSEGC,GMTSEG,ORGMTSEG,ORSEGC,ORSEGI
K ^TMP("ORDATA",$J)
D REPORT^GMTSADH5(.ORGMTSEG,.ORSEGC,.ORSEGI,.ORCOMPS,.ORDFN)
Q:'$O(ORGMTSEG(0))
D START^ORWRP(80,"REPORT1^ORWRP2(.ORGMTSEG,.ORSEGC,.ORSEGI,ORDFN)")
S OROOT=$NA(^TMP("ORDATA",$J,1))
Q
REPORT1(GMTSEG,GMTSEGC,GMTSEGI,DFN) ;
N GMTS,GMTS1,GMTS2,GMTSAGE,GMTSDOB,GMTSDTM,GMTSLO,GMTSLPG,GMTSPHDR,GMTSPNM,GMTSRB,GMTSSN,GMTSWRD
N CNT,INC,ORVP,ROOT,SEX,VADM,VAERR,VAIN
S ORVP=DFN
D ADHOC^ORPRS13
Q
;
SUBITEM(ORY,ORTEST) ;Get Subitems for a Test Panel
;RPC => ORWRP2 HS SUBITEMS
D SUBITEM^GMTSADH5(.ORY,ORTEST)
Q
PREPORT(OROOT,ORCOMPS,ORDFN) ;Build Report & Print
;Called from File|Print on Reports Tab after selecting ADHOC Health Summary
;COMPS(i)=array of subcomponents chosen, value is pointer at ^GMT(142,DA(1),1,DA)
Q:'$G(ORDFN)
N GMTSEGC,GMTSEG,ORGMTSEG,ORSEGC,ORSEGI
D REPORT^GMTSADH5(.ORGMTSEG,.ORSEGC,.ORSEGI,.ORCOMPS,.ORDFN)
Q:'$O(ORGMTSEG(0))
M GMTSEG=ORGMTSEG,GMTSEGC=ORSEGC,GMTSEGI=ORSEGI
N GMTS,GMTS1,GMTS2,GMTSAGE,GMTSDOB,GMTSDTM,GMTSLO,GMTSLPG,GMTSPHDR,GMTSPNM,GMTSRB,GMTSSN,GMTSWRD
N CNT,INC,ORVP,ROOT,SEX,VADM,VAERR,VAIN
S ORVP=ORDFN
D ADHOC^ORPRS13
Q
ORWRP2 ; dcm/slc - Health Summary adhoc RPC's
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,109**;Dec 17, 1997
COMP(ORY) ;Get ADHOC sub components (FILE 142.1)
+1 ;RPC => ORWRP2 HS COMPONENTS
+2 ;Y(i)=(1)I;IFN^(2)Component Name [Abb]^(3)Occ Limit^(4)Time Limit^(5)Header Name^
+3 ; (6)Hosp Loc Disp^(7)ICD Text Disp^(8)Prov Narr Disp^(9)Summary Order
+4 DO COMP^GMTSADH5(.ORY)
+5 QUIT
+6 ;
COMPABV(ORY) ;Get ADHOD sub components listed by Abbreviation
+1 NEW I,X,X1,X2,X3
+2 DO COMP^GMTSADH5(.ORY)
+3 SET I=0
+4 FOR
SET I=$ORDER(ORY(I))
IF 'I
QUIT
SET X=ORY(I)
Begin DoDot:1
+5 SET X1=$PIECE($PIECE(X,"^",2),"[")
SET X1=$EXTRACT(X1,1,$LENGTH(X1)-1)
SET X2=$PIECE($PIECE(X,"^",2),"[",2)
SET X2=$EXTRACT(X2,1,$LENGTH(X2)-1)
+6 ;S X3=X2_" - "_X1_" ",$P(ORY(I),"^",2)=X3
+7 SET X3=X2_" - "_$PIECE(X,"^",5)_" "
SET $PIECE(ORY(I),"^",2)=X3
End DoDot:1
+8 QUIT
COMPDISP(ORY) ;Get ADHOD sub components listed by Display Name
+1 NEW I,X,X1,X2,X3
+2 DO COMP^GMTSADH5(.ORY)
+3 SET I=0
+4 FOR
SET I=$ORDER(ORY(I))
IF 'I
QUIT
SET X=ORY(I)
Begin DoDot:1
+5 SET X1=$PIECE($PIECE(X,"^",2),"[")
SET X1=$EXTRACT(X1,1,$LENGTH(X1)-1)
SET X2=$PIECE($PIECE(X,"^",2),"[",2)
SET X2=$EXTRACT(X2,1,$LENGTH(X2)-1)
+6 SET X3=$PIECE(X,"^",5)_" ["_X2_"]"
SET $PIECE(ORY(I),"^",2)=X3
End DoDot:1
+7 QUIT
COMPSUB(ORY,ORSUB) ;Get subitems from a predefined Adhoc component
+1 IF '$LENGTH($TEXT(COMPSUB^GMTSADH5))
QUIT
+2 DO COMPSUB^GMTSADH5(.ORY,ORSUB)
+3 QUIT
+4 ;
SAVLKUP(OK,VAL) ;save Adhoc lookup selection
+1 NEW ORERR
+2 SET OK=""
+3 DO EN^XPAR(DUZ_";VA(200,","ORWRP ADHOC LOOKUP",1,VAL,.ORERR)
+4 IF ORERR
SET OK=VAL_":"_ORERR
+5 QUIT
GETLKUP(ORY) ;Get Adhoc lookup selection
+1 SET ORY=$$GET^XPAR("ALL","ORWRP ADHOC LOOKUP",1,"I")
+2 QUIT
FILES(ORY,ORCOMP) ;Get Files to select from for a component
+1 ;RPC => ORWRP2 HS COMP FILES
+2 DO FILES^GMTSADH5(.ORY,ORCOMP)
+3 QUIT
+4 ;
FILESEL(OROOT,ORFILE,ORFROM,ORDIR) ;Get file entries for Combobox
+1 ;RPC => ORWRP2 HS FILE LOOKUP
+2 DO FILESEL^GMTSADH5(.OROOT,ORFILE,ORFROM,ORDIR)
+3 QUIT
+4 ;
REPORT(OROOT,ORCOMPS,ORDFN) ;Build Report from array of Components passed in COMPS
+1 ;RPC => ORWRP2 HS REPORT TEXT
+2 ;ORCOMPS(i)=array of subcomponents chosen, value is pointer at ^GMT(142,DA(1),1,DA)
+3 IF '$GET(ORDFN)
QUIT
+4 NEW GMTSEGC,GMTSEG,ORGMTSEG,ORSEGC,ORSEGI
+5 KILL ^TMP("ORDATA",$JOB)
+6 DO REPORT^GMTSADH5(.ORGMTSEG,.ORSEGC,.ORSEGI,.ORCOMPS,.ORDFN)
+7 IF '$ORDER(ORGMTSEG(0))
QUIT
+8 DO START^ORWRP(80,"REPORT1^ORWRP2(.ORGMTSEG,.ORSEGC,.ORSEGI,ORDFN)")
+9 SET OROOT=$NAME(^TMP("ORDATA",$JOB,1))
+10 QUIT
REPORT1(GMTSEG,GMTSEGC,GMTSEGI,DFN) ;
+1 NEW GMTS,GMTS1,GMTS2,GMTSAGE,GMTSDOB,GMTSDTM,GMTSLO,GMTSLPG,GMTSPHDR,GMTSPNM,GMTSRB,GMTSSN,GMTSWRD
+2 NEW CNT,INC,ORVP,ROOT,SEX,VADM,VAERR,VAIN
+3 SET ORVP=DFN
+4 DO ADHOC^ORPRS13
+5 QUIT
+6 ;
SUBITEM(ORY,ORTEST) ;Get Subitems for a Test Panel
+1 ;RPC => ORWRP2 HS SUBITEMS
+2 DO SUBITEM^GMTSADH5(.ORY,ORTEST)
+3 QUIT
PREPORT(OROOT,ORCOMPS,ORDFN) ;Build Report & Print
+1 ;Called from File|Print on Reports Tab after selecting ADHOC Health Summary
+2 ;COMPS(i)=array of subcomponents chosen, value is pointer at ^GMT(142,DA(1),1,DA)
+3 IF '$GET(ORDFN)
QUIT
+4 NEW GMTSEGC,GMTSEG,ORGMTSEG,ORSEGC,ORSEGI
+5 DO REPORT^GMTSADH5(.ORGMTSEG,.ORSEGC,.ORSEGI,.ORCOMPS,.ORDFN)
+6 IF '$ORDER(ORGMTSEG(0))
QUIT
+7 MERGE GMTSEG=ORGMTSEG,GMTSEGC=ORSEGC,GMTSEGI=ORSEGI
+8 NEW GMTS,GMTS1,GMTS2,GMTSAGE,GMTSDOB,GMTSDTM,GMTSLO,GMTSLPG,GMTSPHDR,GMTSPNM,GMTSRB,GMTSSN,GMTSWRD
+9 NEW CNT,INC,ORVP,ROOT,SEX,VADM,VAERR,VAIN
+10 SET ORVP=ORDFN
+11 DO ADHOC^ORPRS13
+12 QUIT