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

BGP7DP3.m

Go to the documentation of this file.
BGP7DP3 ; IHS/CMI/LAB - print ind 1 ;
 ;;17.1;IHS CLINICAL REPORTING;;MAY 10, 2017;Build 29
 ;
 ;PUBLIC HEALTH NURSING
I023 ;EP
 S BGPORXX=$P(^BGPINDG(BGPIC,12),U,6)
 D H1 S BGPNODEN=1
 F BGPPC1=BGPORXX_".1" D PI^BGP7DP1C 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(^BGPINDGC("OR",BGPPC1,0))
 Q:'$$CHECK^BGP7DP1E(BGPPC)
 S BGPPC=BGPPC D
 .S BGPDF=$P(^BGPINDGC(BGPPC,0),U,9)
 .;I $P(^BGPINDGC(BGPPC,0),U,4)[".3" S BGPDF=23.503
 .;I $P(^BGPINDGC(BGPPC,0),U,4)[".4" S BGPDF=23.504
 .S BGPNP=$P(^DD(90558.03,BGPDF,0),U,4),N=$P(BGPNP,";"),P=$P(BGPNP,";",2)
 .S BGPCYD=$$V^BGP7DP1C(1,BGPRPT,N,P,1) I $G(BGPAREAA) D SETEXA^BGP7DP1C(1,N,P)
 .S BGPPRD=$$V^BGP7DP1C(2,BGPRPT,N,P,1) I $G(BGPAREAA) D SETEXA^BGP7DP1C(2,N,P)
 .S BGPBLD=$$V^BGP7DP1C(3,BGPRPT,N,P,1) I $G(BGPAREAA) D SETEXA^BGP7DP1C(3,N,P)
 .S BGPNF=$P(^BGPINDGC(BGPPC,0),U,9)
 .S BGPNP=$P(^DD(90558.03,BGPNF,0),U,4),N=$P(BGPNP,";"),P=$P(BGPNP,";",2)
 .D SETN
 .I $P($G(^BGPINDGC(BGPPC,14)),U) D
 ..S ^TMP($J,"SUMMARY",$P(^BGPSCAT($P(^BGPINDGC(BGPPC,14),U,5),0),U,2),$P(^BGPINDGC(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(^BGPINDGC(BGPPC,14),U,5),0),U,2),$P(^BGPINDGC(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(^BGPINDGC(BGPPC,15)),U) D
 ..S ^TMP($J,"SUMMARY NON",$P(^BGPSCAT($P(^BGPINDGC(BGPPC,15),U,5),0),U,3),$P(^BGPINDGC(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(^BGPINDGC(BGPPC,15),U,5),0),U,3),$P(^BGPINDGC(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(^BGPINDGC(BGPPC,22)),U) D
 ..S ^TMP($J,"SUMMARY DEVEL",$P(^BGPSCAT($P(^BGPINDGC(BGPPC,22),U,5),0),U,3),$P(^BGPINDGC(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(^BGPINDGC(BGPPC,22),U,5),0),U,3),$P(^BGPINDGC(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(^BGPINDGC(BGPPC,19)),U) D
 ..S ^TMP($J,"SUMMARY OTHER",$P(^BGPSCAT($P(^BGPINDGC(BGPPC,19),U,5),0),U,3),$P(^BGPINDGC(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(^BGPINDGC(BGPPC,19),U,5),0),U,3),$P(^BGPINDGC(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^BGP7DPH Q:BGPQUIT  W !!,^BGPINDG(BGPIC,53,1,0) W:$D(^BGPINDG(BGPIC,53,2,0)) !,^BGPINDG(BGPIC,53,2,0) D H1
 .;I BGPRTYPE'=1 W !!,$P(^BGPINDGC(BGPPC,0),U,15)
 .;I BGPRTYPE=1 W !!
 .I '$G(BGPSUMON) D
 ..S X=$$LABEL^BGP7UTL1(BGPPC,BGPRTYPE,BGPPTYPE,$G(BGPINDG),"N")
 ..W !,$P(X,U,1)
 ..F I=2:1 S Y=$P(X,U,I) Q:Y=""  W !," ",Y
 .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^BGP7DP1C
 ;I $P(^BGPINDGC(BGPPC,0),U,4)[".1"
 K BGPNOSUM
 S (BGPCYP,BGPPRP,BGPBLP)=""
 Q