Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BGP9DP3

BGP9DP3.m

Go to the documentation of this file.
BGP9DP3 ; IHS/CMI/LAB - print ind 1 ;
 ;;9.0;IHS CLINICAL REPORTING;;JUL 1, 2009
 ;
 ;PUBLIC HEALTH NURSING
I023 ;EP
 S BGPORXX=$P(^BGPINDN(BGPIC,0),U,6)
 D H1 S BGPNODEN=1
 F BGPPC1=BGPORXX_".1" D PI^BGP9DP1C Q:BGPQUIT
 Q:BGPQUIT
 F BGPPC1=BGPORXX_".2.1",BGPORXX_".2.2",BGPORXX_".2.3",BGPORXX_".2.4",BGPORXX_".2.5",BGPORXX_".2.6" Q:BGPQUIT  D PI
 Q:BGPQUIT
 W:'$G(BGPSUMON) ! F BGPPC1=BGPORXX_".3.1",BGPORXX_".3.2",BGPORXX_".3.3",BGPORXX_".3.4",BGPORXX_".3.5",BGPORXX_".3.6" Q:BGPQUIT  D PI
 Q
PI ;EP
 K BGPCYP,BGPBLP,BGPPRD,BGPEXCT,BGPSDP,BGPSDPN,BGPSDPD
 S BGPPC=$O(^BGPINDNC("OR",BGPPC1,0))
 I BGPRTYPE=1,$P(^BGPINDNC(BGPPC,0),U,5)'=1 Q  ;not on national
 I BGPRTYPE=7,$P($G(^BGPINDNC(BGPPC,12)),U,12)'=1 Q  ;not on other national
 I BGPINDT="D",$P(^BGPINDNC(BGPPC,0),U,12)'=1 Q
 I BGPINDT="C",$P(^BGPINDNC(BGPPC,0),U,13)'=1 Q
 I BGPINDT="W",$P($G(^BGPINDNC(BGPPC,12)),U,2)'=1 Q
 S BGPPC=BGPPC D
 .S BGPDF=$P(^BGPINDNC(BGPPC,0),U,9)
 .;I $P(^BGPINDNC(BGPPC,0),U,4)[".3" S BGPDF=23.503
 .;I $P(^BGPINDNC(BGPPC,0),U,4)[".4" S BGPDF=23.504
 .S BGPNP=$P(^DD(90536.03,BGPDF,0),U,4),N=$P(BGPNP,";"),P=$P(BGPNP,";",2)
 .S BGPCYD=$$V^BGP9DP1C(1,BGPRPT,N,P,1) I $G(BGPAREAA) D SETEXA^BGP9DP1C(1,N,P)
 .S BGPPRD=$$V^BGP9DP1C(2,BGPRPT,N,P,1) I $G(BGPAREAA) D SETEXA^BGP9DP1C(2,N,P)
 .S BGPBLD=$$V^BGP9DP1C(3,BGPRPT,N,P,1) I $G(BGPAREAA) D SETEXA^BGP9DP1C(3,N,P)
 .S BGPNF=$P(^BGPINDNC(BGPPC,0),U,9)
 .S BGPNP=$P(^DD(90536.03,BGPNF,0),U,4),N=$P(BGPNP,";"),P=$P(BGPNP,";",2)
 .D SETN
 .I $P($G(^BGPINDNC(BGPPC,14)),U) D
 ..S ^TMP($J,"SUMMARY",$P(^BGPSCAT($P(^BGPINDNC(BGPPC,14),U,5),0),U,2),$P(^BGPINDNC(BGPPC,14),U,6),BGPPC)=BGPCYN_U_BGPPRN_U_BGPBLN
 ..Q:'$G(BGPAREAA)
 ..S X=0 F  S X=$O(BGPSDP(X)) Q:X'=+X  D  ;SDPX
 ...S ^TMP($J,"SUMMARY DETAIL PAGE",$P(^BGPSCAT($P(^BGPINDNC(BGPPC,14),U,5),0),U,2),$P(^BGPINDNC(BGPPC,14),U,6),BGPPC,X)=$P($G(BGPSDP(X,1)),U,2)_U_$P($G(BGPSDP(X,2)),U,2)_U_$P($G(BGPSDP(X,3)),U,2)_U_BGPCYN
 .;NON
 .I $P($G(^BGPINDNC(BGPPC,15)),U) D
 ..S ^TMP($J,"SUMMARY NON",$P(^BGPSCAT($P(^BGPINDNC(BGPPC,15),U,5),0),U,3),$P(^BGPINDNC(BGPPC,15),U,6),BGPPC)=BGPCYN_U_BGPPRN_U_BGPBLN
 ..I $G(BGPAREAA) D  ;SDPX
 ...S X=0 F  S X=$O(BGPSDPN(X)) Q:X'=+X  D  ;SDPX
 ....S ^TMP($J,"SUMMARY DETAIL PAGE NON",$P(^BGPSCAT($P(^BGPINDNC(BGPPC,15),U,5),0),U,3),$P(^BGPINDNC(BGPPC,15),U,6),BGPPC,X)=$P($G(BGPSDPN(X,1)),U,2)_U_$P($G(BGPSDPN(X,2)),U,2)_U_$P($G(BGPSDPN(X,3)),U,2)_U_BGPCYN
 .;DEVEL
 .I $P($G(^BGPINDNC(BGPPC,22)),U) D
 ..S ^TMP($J,"SUMMARY DEVEL",$P(^BGPSCAT($P(^BGPINDNC(BGPPC,22),U,5),0),U,3),$P(^BGPINDNC(BGPPC,22),U,6),BGPPC)=BGPCYN_U_BGPPRN_U_BGPBLN
 ..I $G(BGPAREAA) D  ;SDPX
 ...S X=0 F  S X=$O(BGPSDPD(X)) Q:X'=+X  D  ;SDPX
 ....S ^TMP($J,"SUMMARY DETAIL PAGE DEVEL",$P(^BGPSCAT($P(^BGPINDNC(BGPPC,22),U,5),0),U,3),$P(^BGPINDNC(BGPPC,22),U,6),BGPPC,X)=$P($G(BGPSDPD(X,1)),U,2)_U_$P($G(BGPSDPD(X,2)),U,2)_U_$P($G(BGPSDPD(X,3)),U,2)_U_BGPCYN
 .;OTHER
 .I $P($G(^BGPINDNC(BGPPC,19)),U) D
 ..S ^TMP($J,"SUMMARY OTHER",$P(^BGPSCAT($P(^BGPINDNC(BGPPC,19),U,5),0),U,3),$P(^BGPINDNC(BGPPC,19),U,6),BGPPC)=BGPCYN_U_BGPPRN_U_BGPBLN
 ..I $G(BGPAREAA) D  ;SDPX
 ...S X=0 F  S X=$O(BGPSDPO(X)) Q:X'=+X  D  ;SDPX
 ....S ^TMP($J,"SUMMARY DETAIL PAGE OTHER",$P(^BGPSCAT($P(^BGPINDNC(BGPPC,19),U,5),0),U,3),$P(^BGPINDNC(BGPPC,19),U,6),BGPPC,X)=$P($G(BGPSDPO(X,1)),U,2)_U_$P($G(BGPSDPO(X,2)),U,2)_U_$P($G(BGPSDPO(X,3)),U,2)_U_BGPCYN
 .;write header for 1.A.1
 .I $Y>(BGPIOSL-6),'$G(BGPSUMON) D HEADER^BGP9DPH Q:BGPQUIT  W !!,^BGPINDN(BGPIC,53,1,0) W:$D(^BGPINDN(BGPIC,53,2,0)) !,^BGPINDN(BGPIC,53,2,0) D H1
 .;I BGPRTYPE'=1 W !!,$P(^BGPINDNC(BGPPC,0),U,15)
 .;I BGPRTYPE=1 W !!
 .W:'$G(BGPSUMON) !! D
 ..W:'$G(BGPSUMON) $P(^BGPINDNC(BGPPC,0),U,15)
 .I $P(^BGPINDNC(BGPPC,0),U,16)]"" W:'$G(BGPSUMON) !?1,$P(^BGPINDNC(BGPPC,0),U,16)
 .I $P(^BGPINDNC(BGPPC,0),U,19)]"" W:'$G(BGPSUMON) !?1,$P(^BGPINDNC(BGPPC,0),U,19)
 .;I BGPRTYPE'=4,$P(^BGPINDNC(BGPPC,0),U,19)]"",$P(^BGPINDNC(BGPPC,0),U,19)'["GPRA" W !?1,$P(^BGPINDNC(BGPPC,0),U,19)
 .D H2
 Q
H2 ;EP
 Q:$G(BGPSUMON)
 S BGPX="",BGPX=$$C(BGPCYN,0,7),$E(BGPX,16)=$$C(BGPPRN,0,7),$E(BGPX,24)="",$E(BGPX,33)=$$CALC(BGPCYN,BGPPRN)
 S $E(BGPX,39)=$$C(BGPBLN,0,7),$E(BGPX,47)="",$E(BGPX,56)=$$CALC(BGPCYN,BGPBLN)
 W ?21,BGPX
 Q
H1 ;EP
 Q:$G(BGPSUMON)
 W !!?21,"REPORT",?31,"",?35,"PREV YR",?46,"",?49,"CHG from",?59,"BASE",?69,"",?72,"CHG from"
 W !?21,"PERIOD     %",?35,"PERIOD     %",?49,"PREV YR ",?59,"PERIOD    %",?72,"BASE "
 Q
CALC(N,O) ;ENTRY POINT
 NEW Z
 S Z=N-O,Z=$FN(Z,"+,",0)
 Q Z
C(X,X2,X3) ;
 D COMMA^%DTC
 Q X
SETN ;set numerator fields
 S BGPNOSUM=1
 D SETN^BGP9DP1C
 ;I $P(^BGPINDNC(BGPPC,0),U,4)[".1"
 K BGPNOSUM
 S (BGPCYP,BGPPRP,BGPBLP)=""
 Q