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

BGP5DP3.m

Go to the documentation of this file.
BGP5DP3 ; IHS/CMI/LAB - print ind 1 ;
 ;;15.1;IHS CLINICAL REPORTING;;MAY 06, 2015;Build 143
 ;
 ;PUBLIC HEALTH NURSING
I023 ;EP
 S BGPORXX=$P(^BGPINDK(BGPIC,12),U,6)
 D H1 S BGPNODEN=1
 F BGPPC1=BGPORXX_".1" D PI^BGP5DP1C 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(^BGPINDKC("OR",BGPPC1,0))
 Q:'$$CHECK^BGP5DP1E(BGPPC)
 S BGPPC=BGPPC D
 .S BGPDF=$P(^BGPINDKC(BGPPC,0),U,9)
 .;I $P(^BGPINDKC(BGPPC,0),U,4)[".3" S BGPDF=23.503
 .;I $P(^BGPINDKC(BGPPC,0),U,4)[".4" S BGPDF=23.504
 .S BGPNP=$P(^DD(90554.03,BGPDF,0),U,4),N=$P(BGPNP,";"),P=$P(BGPNP,";",2)
 .S BGPCYD=$$V^BGP5DP1C(1,BGPRPT,N,P,1) I $G(BGPAREAA) D SETEXA^BGP5DP1C(1,N,P)
 .S BGPPRD=$$V^BGP5DP1C(2,BGPRPT,N,P,1) I $G(BGPAREAA) D SETEXA^BGP5DP1C(2,N,P)
 .S BGPBLD=$$V^BGP5DP1C(3,BGPRPT,N,P,1) I $G(BGPAREAA) D SETEXA^BGP5DP1C(3,N,P)
 .S BGPNF=$P(^BGPINDKC(BGPPC,0),U,9)
 .S BGPNP=$P(^DD(90554.03,BGPNF,0),U,4),N=$P(BGPNP,";"),P=$P(BGPNP,";",2)
 .D SETN
 .I $P($G(^BGPINDKC(BGPPC,14)),U) D
 ..S ^TMP($J,"SUMMARY",$P(^BGPSCAT($P(^BGPINDKC(BGPPC,14),U,5),0),U,2),$P(^BGPINDKC(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(^BGPINDKC(BGPPC,14),U,5),0),U,2),$P(^BGPINDKC(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(^BGPINDKC(BGPPC,15)),U) D
 ..S ^TMP($J,"SUMMARY NON",$P(^BGPSCAT($P(^BGPINDKC(BGPPC,15),U,5),0),U,3),$P(^BGPINDKC(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(^BGPINDKC(BGPPC,15),U,5),0),U,3),$P(^BGPINDKC(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(^BGPINDKC(BGPPC,22)),U) D
 ..S ^TMP($J,"SUMMARY DEVEL",$P(^BGPSCAT($P(^BGPINDKC(BGPPC,22),U,5),0),U,3),$P(^BGPINDKC(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(^BGPINDKC(BGPPC,22),U,5),0),U,3),$P(^BGPINDKC(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(^BGPINDKC(BGPPC,19)),U) D
 ..S ^TMP($J,"SUMMARY OTHER",$P(^BGPSCAT($P(^BGPINDKC(BGPPC,19),U,5),0),U,3),$P(^BGPINDKC(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(^BGPINDKC(BGPPC,19),U,5),0),U,3),$P(^BGPINDKC(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^BGP5DPH Q:BGPQUIT  W !!,^BGPINDK(BGPIC,53,1,0) W:$D(^BGPINDK(BGPIC,53,2,0)) !,^BGPINDK(BGPIC,53,2,0) D H1
 .;I BGPRTYPE'=1 W !!,$P(^BGPINDKC(BGPPC,0),U,15)
 .;I BGPRTYPE=1 W !!
 .W:'$G(BGPSUMON) !! D
 ..W:'$G(BGPSUMON) $P(^BGPINDKC(BGPPC,0),U,15)
 .I $P(^BGPINDKC(BGPPC,0),U,16)]"" W:'$G(BGPSUMON) !?1,$P(^BGPINDKC(BGPPC,0),U,16)
 .I $P(^BGPINDKC(BGPPC,0),U,19)]"" W:'$G(BGPSUMON) !?1,$P(^BGPINDKC(BGPPC,0),U,19)
 .;I BGPRTYPE'=4,$P(^BGPINDKC(BGPPC,0),U,19)]"",$P(^BGPINDKC(BGPPC,0),U,19)'["GPRA" W !?1,$P(^BGPINDKC(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^BGP5DP1C
 ;I $P(^BGPINDKC(BGPPC,0),U,4)[".1"
 K BGPNOSUM
 S (BGPCYP,BGPPRP,BGPBLP)=""
 Q