ORWRPBHS ;IHS/CIA/DKM - IHS Health Summary Support for Reports Component ;27-Feb-2007 11:27;DKM
;;3.0;ORDER ENTRY/RESULTS REPORTING;**1002**;Dec 17, 1997
;=================================================================
; Generate health summary
HS(ORROOT,ORDFN,ORHS,ALPHA,OMEGA,DTRANGE,REMOTE,ORMAX,ORFHIE) ; - get health summary report
D CAPTURE^CIAUHFS("D HSX^ORWRPBHS(.ORROOT,.ORDFN,.ORHS,.ALPHA,.OMEGA,.DTRANGE,.REMOTE,.ORMAX,.ORFHIE)",.ROOT,80)
Q
; Print report
HSX(ROOT,APCHSPAT,APCHSTYP,ALPHA,OMEGA,DTRANGE,REMOTE,ORMAX,ORFHIE) ;
N Y,$ET
S $ET="",@$$TRAP^CIAUOS("HSXERR^ORWRPBHS")
I $G(REMOTE) D Q:'APCHSTYP
.S Y=$O(^APCHSCTL("B",$P(APCHSTYP,";",2),0))
.I 'Y U IO W !,APCHSTYP_" not found on remote system",!
.S APCHSTYP=Y
I APCHSTYP<1 W !,"Report not Available" Q
S APCHSTYP=+APCHSTYP
D START^APCHS0
Q
; Exception handler for HSX
HSXERR W "An error was encountered generating this report.",!
W "The error was: ",$$EC^%ZOSV,!
D ^%ZTER
Q
; Background print
HSB(ROOT,ORDFN,ORHSTYPE,ORALPHA,OROMEGA,ORDTRNG,REMOTE,ORMAX,ORFHIE) ;
I $O(ORCOMP(0)) D SITE^ORWRPP($G(STATION)),PREPORT^ORWRP2(.ROOT,.ORCOMP,.ORDFN) Q
D SITE^ORWRPP($G(STATION)),HSX(.ROOT,.ORDFN,.ORHSTYPE,.ORALPHA,.OROMEGA,.ORDTRNG,.REMOTE,.ORMAX,.ORFHIE)
Q
; Get list of IHS health summary types
GETHS(ROOT,EOF) ;
N C,I,HS
I $$GET^XPAR("ALL","ORWRP HEALTH SUMMARY LIST ALL",1) D
.S I="",C=0
.F S I=$O(^APCHSCTL("B",I)) Q:I="" S C=C+1,HS(C)=$O(^(I,0))_U_I
E D GETLST^XPAR(.HS,"ALL","ORWRPBHS HEALTH SUMMARY LIST","N")
S I=0
F S I=$O(HS(I)) Q:'I D
.S:$P(HS(I),U,2)="GMTS HS ADHOC OPTION" HS(I)="0^Adhoc Report"
.D SETITEM^ORWRP(.ROOT,"x"_HS(I))
Q
ORWRPBHS ;IHS/CIA/DKM - IHS Health Summary Support for Reports Component ;27-Feb-2007 11:27;DKM
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**1002**;Dec 17, 1997
+2 ;=================================================================
+3 ; Generate health summary
HS(ORROOT,ORDFN,ORHS,ALPHA,OMEGA,DTRANGE,REMOTE,ORMAX,ORFHIE) ; - get health summary report
+1 DO CAPTURE^CIAUHFS("D HSX^ORWRPBHS(.ORROOT,.ORDFN,.ORHS,.ALPHA,.OMEGA,.DTRANGE,.REMOTE,.ORMAX,.ORFHIE)",.ROOT,80)
+2 QUIT
+3 ; Print report
HSX(ROOT,APCHSPAT,APCHSTYP,ALPHA,OMEGA,DTRANGE,REMOTE,ORMAX,ORFHIE) ;
+1 NEW Y,$ETRAP
+2 SET $ETRAP=""
SET @$$TRAP^CIAUOS("HSXERR^ORWRPBHS")
+3 IF $GET(REMOTE)
Begin DoDot:1
+4 SET Y=$ORDER(^APCHSCTL("B",$PIECE(APCHSTYP,";",2),0))
+5 IF 'Y
USE IO
WRITE !,APCHSTYP_" not found on remote system",!
+6 SET APCHSTYP=Y
End DoDot:1
IF 'APCHSTYP
QUIT
+7 IF APCHSTYP<1
WRITE !,"Report not Available"
QUIT
+8 SET APCHSTYP=+APCHSTYP
+9 DO START^APCHS0
+10 QUIT
+11 ; Exception handler for HSX
HSXERR WRITE "An error was encountered generating this report.",!
+1 WRITE "The error was: ",$$EC^%ZOSV,!
+2 DO ^%ZTER
+3 QUIT
+4 ; Background print
HSB(ROOT,ORDFN,ORHSTYPE,ORALPHA,OROMEGA,ORDTRNG,REMOTE,ORMAX,ORFHIE) ;
+1 IF $ORDER(ORCOMP(0))
DO SITE^ORWRPP($GET(STATION))
DO PREPORT^ORWRP2(.ROOT,.ORCOMP,.ORDFN)
QUIT
+2 DO SITE^ORWRPP($GET(STATION))
DO HSX(.ROOT,.ORDFN,.ORHSTYPE,.ORALPHA,.OROMEGA,.ORDTRNG,.REMOTE,.ORMAX,.ORFHIE)
+3 QUIT
+4 ; Get list of IHS health summary types
GETHS(ROOT,EOF) ;
+1 NEW C,I,HS
+2 IF $$GET^XPAR("ALL","ORWRP HEALTH SUMMARY LIST ALL",1)
Begin DoDot:1
+3 SET I=""
SET C=0
+4 FOR
SET I=$ORDER(^APCHSCTL("B",I))
IF I=""
QUIT
SET C=C+1
SET HS(C)=$ORDER(^(I,0))_U_I
End DoDot:1
+5 IF '$TEST
DO GETLST^XPAR(.HS,"ALL","ORWRPBHS HEALTH SUMMARY LIST","N")
+6 SET I=0
+7 FOR
SET I=$ORDER(HS(I))
IF 'I
QUIT
Begin DoDot:1
+8 IF $PIECE(HS(I),U,2)="GMTS HS ADHOC OPTION"
SET HS(I)="0^Adhoc Report"
+9 DO SETITEM^ORWRP(.ROOT,"x"_HS(I))
End DoDot:1
+10 QUIT