- BGP8GM ; IHS/CMI/LAB - BGPG Visual CRS Reports ;
- ;;18.1;IHS CLINICAL REPORTING;;MAY 25, 2018;Build 66
- MUEP(RETVAL,BGPSTR) ;sel measures by comm
- S X="MERR^BGP8GU",@^%ZOSF("TRAP")
- N BGPI,BGPJ,BGPDATA,BGPDA,P,BGPERR,BGPCT,BGPOT,BGPOPT,BGPRT,P,R,A
- N BGPTP,BGPQTR,BGPRDT,BGPRE,BGPBAS,BGPPATT,BGPLIST,BGPPRV,BGPPROV,BGPIND,BGPINDI,BGPLSTI
- S P="|",R="~",A="*"
- I $G(BGPSTR)="" D CATSTR(.BGPSTR,.BGPSTR)
- S BGPI=0
- S BGPERR=""
- S BGPCT=$P($P(BGPSTR,P),R) ;THIS WILL BE NULL AS WE DON'T NEED COMMUNITY TAXONOMY
- S BGPTP=$E($P(BGPSTR,P,2)) ;Will be A, C, M, S for indicators selected
- S BGPQTR=$P(BGPSTR,P,3) ; will be 1 for 90 days, 2 for one year (see BGPMUEP)
- S BGPRDT=$P(BGPSTR,P,4) ;time to run the report
- S BGPRE=$P(BGPSTR,P,5) ;beginning date for report user entered e.g. 3110901
- S BGPOPT="CRS 18 EP MU REPORT"
- S BGPBAS=$P(BGPSTR,P,6) ;BASE LINE YEAR IN 3000000 FORMAT (YEAR ONLY)
- S BGPBEB=$P(BGPSTR,P,7) ;beneficiary
- S BGPLSTT=$P(BGPSTR,P,8) ; TYPE OF LIST: D Pts. Not in numerator N Pts in numerator A All Patients - THIS IS DIFFERENT THAN OUR REPORTS
- S BGPPRV=$P($P(BGPSTR,P,9),R) ;provider name they are running the report for
- S BGPPROV=$P($P(BGPSTR,P,9),R,2) ;provider ien they are running the report for
- I $G(BGPPROV)="" S BGPPROV=$P($G(^VA(200,BGPPRV,0)),U)
- S BGPOT=$P(BGPSTR,P,10) ;output type D, P, B, X -NOTE: X IS XML - not sure how you will deal with this
- S BGPFN=$P(BGPSTR,P,14) ;FILENAME
- S BGPINDI=$P(BGPSTR,P,12) ;string with indicators from BGPMU 11 MEASURES
- S BGPMFITI=$P(BGPSTR,P,13) ;will be null, we don't need MFI stuff
- S BGPLSTI=$P(BGPSTR,P,11) ;list of measures from BGPMU 11 MEASURES.
- ;NOTE: BGPINDI IS only necessary if M or S is selected
- N I
- F I=2:1 D Q:$P(BGPLSTI,A,I)=""
- . Q:$P(BGPLSTI,A,I)=""
- . N BGPL
- . S BGPL=$P($P(BGPLSTI,A,I),R)
- . Q:'$G(BGPL)
- . S BGPLIST(BGPL)=""
- N J
- F J=2:1 D Q:$P(BGPINDI,A,J)=""
- . Q:$P(BGPINDI,A,J)=""
- . N BGPL
- . S BGPL=$P($P(BGPINDI,A,J),R)
- . S BGPIND(BGPL)=""
- K ^BGPTMP($J)
- S RETVAL="^BGPTMP("_$J_")"
- S ^BGPTMP($J,BGPI)="T00250DATA"_$C(30)
- D EP^BGP8GMUE(.BGPERR,DUZ,DUZ(2),BGPOPT,BGPCT,BGPTP,.BGPIND,BGPQTR,BGPRE,BGPBAS,$G(BGPBEB),BGPLSTT,.BGPLIST,BGPPRV,BGPPROV,$G(BGPOT),BGPRDT,BGPMFITI,BGPFN)
- S BGPI=BGPI+1
- S ^BGPTMP($J,BGPI)=+$G(BGPERR)_$C(30)
- S ^BGPTMP($J,BGPI+1)=$C(31)
- D EN^XBVK("BGP")
- Q
- ;
- MUHOS(RETVAL,BGPSTR) ;sel measures by comm
- S X="MERR^BGP8GU",@^%ZOSF("TRAP")
- N BGPI,BGPJ,BGPDATA,BGPDA,P,BGPERR,BGPCT,BGPOT,BGPOPT,BGPRT,P,R,A
- N BGPTP,BGPQTR,BGPRDT,BGPRE,BGPBAS,BGPPATT,BGPLIST,BGPPRV,BGPPROV,BGPIND,BGPINDI,BGPLSTI
- S P="|",R="~",A="*"
- I $G(BGPSTR)="" D CATSTR(.BGPSTR,.BGPSTR)
- S BGPI=0
- S BGPERR=""
- S BGPCT=$P($P(BGPSTR,P),R) ;THIS WILL BE NULL AS WE DON'T NEED COMMUNITY TAXONOMY
- S BGPTP=$E($P(BGPSTR,P,2)) ;Will be A, C, M, S for indicators selected
- S BGPQTR=$P(BGPSTR,P,3) ; will be 1 for 90 days, 2 for one year (see BGPMUEP)
- S BGPRDT=$P(BGPSTR,P,4) ;time to run the report
- S BGPRE=$P(BGPSTR,P,5) ;beginning date for report user entered e.g. 3110901
- S BGPOPT="CRS 18 HOS MU REPORT"
- S BGPBAS=$P(BGPSTR,P,6) ;BASE LINE YEAR IN 3000000 FORMAT (YEAR ONLY)
- S BGPBEB=$P(BGPSTR,P,7) ;beneficiary
- S BGPLSTT=$P(BGPSTR,P,8) ; TYPE OF LIST: D Pts. Not in numerator N Pts in numerator A All Patients - THIS IS DIFFERENT THAN OUR REPORTS
- S BGPPRV=$P($P(BGPSTR,P,9),R) ;provider name they are running the report for
- S BGPPROV=$P($P(BGPSTR,P,9),R,2) ;provider ien they are running the report for
- S BGPOT=$P(BGPSTR,P,10) ;output type D, P, B, X -NOTE: X IS XML - not sure how you will deal with this
- S BGPFN=$P(BGPSTR,P,14) ;FILENAME
- S BGPINDI=$P(BGPSTR,P,12) ;string with indicators from BGPMU 11 MEASURES
- S BGPMFITI=$P(BGPSTR,P,13) ;will be null, we don't need MFI stuff
- S BGPLSTI=$P(BGPSTR,P,11) ;list of measures from BGPMU 11 MEASURES.
- ;NOTE: BGPINDI IS only necessary if M or S is selected
- N I
- F I=2:1 D Q:$P(BGPLSTI,A,I)=""
- . Q:$P(BGPLSTI,A,I)=""
- . N BGPL
- . S BGPL=$P($P(BGPLSTI,A,I),R)
- . Q:'$G(BGPL)
- . S BGPLIST(BGPL)=""
- N J
- F J=2:1 D Q:$P(BGPINDI,A,J)=""
- . Q:$P(BGPINDI,A,J)=""
- . N BGPL
- . S BGPL=$P($P(BGPINDI,A,J),R)
- . S BGPIND(BGPL)=""
- K ^BGPTMP($J)
- S RETVAL="^BGPTMP("_$J_")"
- S ^BGPTMP($J,BGPI)="T00250DATA"_$C(30)
- D EP^BGP8GMUH(.BGPERR,DUZ,DUZ(2),BGPOPT,BGPCT,BGPTP,.BGPIND,BGPQTR,BGPRE,BGPBAS,$G(BGPBEB),BGPLSTT,.BGPLIST,BGPPRV,BGPPROV,$G(BGPOT),BGPRDT,BGPMFITI,BGPFN)
- S BGPI=BGPI+1
- S ^BGPTMP($J,BGPI)=+$G(BGPERR)_$C(30)
- S ^BGPTMP($J,BGPI+1)=$C(31)
- D EN^XBVK("BGP")
- Q
- ;
- CATSTR(BGPSRET,STR) ;EP
- N BGPDA
- S BGPSRET=""
- S BGPDA=0 F S BGPDA=$O(STR(BGPDA)) Q:'BGPDA D
- . S BGPSRET=BGPSRET_$G(STR(BGPDA))
- Q
- ;
- BGP8GM ; IHS/CMI/LAB - BGPG Visual CRS Reports ;
- +1 ;;18.1;IHS CLINICAL REPORTING;;MAY 25, 2018;Build 66
- MUEP(RETVAL,BGPSTR) ;sel measures by comm
- +1 SET X="MERR^BGP8GU"
- SET @^%ZOSF("TRAP")
- +2 NEW BGPI,BGPJ,BGPDATA,BGPDA,P,BGPERR,BGPCT,BGPOT,BGPOPT,BGPRT,P,R,A
- +3 NEW BGPTP,BGPQTR,BGPRDT,BGPRE,BGPBAS,BGPPATT,BGPLIST,BGPPRV,BGPPROV,BGPIND,BGPINDI,BGPLSTI
- +4 SET P="|"
- SET R="~"
- SET A="*"
- +5 IF $GET(BGPSTR)=""
- DO CATSTR(.BGPSTR,.BGPSTR)
- +6 SET BGPI=0
- +7 SET BGPERR=""
- +8 ;THIS WILL BE NULL AS WE DON'T NEED COMMUNITY TAXONOMY
- SET BGPCT=$PIECE($PIECE(BGPSTR,P),R)
- +9 ;Will be A, C, M, S for indicators selected
- SET BGPTP=$EXTRACT($PIECE(BGPSTR,P,2))
- +10 ; will be 1 for 90 days, 2 for one year (see BGPMUEP)
- SET BGPQTR=$PIECE(BGPSTR,P,3)
- +11 ;time to run the report
- SET BGPRDT=$PIECE(BGPSTR,P,4)
- +12 ;beginning date for report user entered e.g. 3110901
- SET BGPRE=$PIECE(BGPSTR,P,5)
- +13 SET BGPOPT="CRS 18 EP MU REPORT"
- +14 ;BASE LINE YEAR IN 3000000 FORMAT (YEAR ONLY)
- SET BGPBAS=$PIECE(BGPSTR,P,6)
- +15 ;beneficiary
- SET BGPBEB=$PIECE(BGPSTR,P,7)
- +16 ; TYPE OF LIST: D Pts. Not in numerator N Pts in numerator A All Patients - THIS IS DIFFERENT THAN OUR REPORTS
- SET BGPLSTT=$PIECE(BGPSTR,P,8)
- +17 ;provider name they are running the report for
- SET BGPPRV=$PIECE($PIECE(BGPSTR,P,9),R)
- +18 ;provider ien they are running the report for
- SET BGPPROV=$PIECE($PIECE(BGPSTR,P,9),R,2)
- +19 IF $GET(BGPPROV)=""
- SET BGPPROV=$PIECE($GET(^VA(200,BGPPRV,0)),U)
- +20 ;output type D, P, B, X -NOTE: X IS XML - not sure how you will deal with this
- SET BGPOT=$PIECE(BGPSTR,P,10)
- +21 ;FILENAME
- SET BGPFN=$PIECE(BGPSTR,P,14)
- +22 ;string with indicators from BGPMU 11 MEASURES
- SET BGPINDI=$PIECE(BGPSTR,P,12)
- +23 ;will be null, we don't need MFI stuff
- SET BGPMFITI=$PIECE(BGPSTR,P,13)
- +24 ;list of measures from BGPMU 11 MEASURES.
- SET BGPLSTI=$PIECE(BGPSTR,P,11)
- +25 ;NOTE: BGPINDI IS only necessary if M or S is selected
- +26 NEW I
- +27 FOR I=2:1
- Begin DoDot:1
- +28 IF $PIECE(BGPLSTI,A,I)=""
- QUIT
- +29 NEW BGPL
- +30 SET BGPL=$PIECE($PIECE(BGPLSTI,A,I),R)
- +31 IF '$GET(BGPL)
- QUIT
- +32 SET BGPLIST(BGPL)=""
- End DoDot:1
- IF $PIECE(BGPLSTI,A,I)=""
- QUIT
- +33 NEW J
- +34 FOR J=2:1
- Begin DoDot:1
- +35 IF $PIECE(BGPINDI,A,J)=""
- QUIT
- +36 NEW BGPL
- +37 SET BGPL=$PIECE($PIECE(BGPINDI,A,J),R)
- +38 SET BGPIND(BGPL)=""
- End DoDot:1
- IF $PIECE(BGPINDI,A,J)=""
- QUIT
- +39 KILL ^BGPTMP($JOB)
- +40 SET RETVAL="^BGPTMP("_$JOB_")"
- +41 SET ^BGPTMP($JOB,BGPI)="T00250DATA"_$CHAR(30)
- +42 DO EP^BGP8GMUE(.BGPERR,DUZ,DUZ(2),BGPOPT,BGPCT,BGPTP,.BGPIND,BGPQTR,BGPRE,BGPBAS,$GET(BGPBEB),BGPLSTT,.BGPLIST,BGPPRV,BGPPROV,$GET(BGPOT),BGPRDT,BGPMFITI,BGPFN)
- +43 SET BGPI=BGPI+1
- +44 SET ^BGPTMP($JOB,BGPI)=+$GET(BGPERR)_$CHAR(30)
- +45 SET ^BGPTMP($JOB,BGPI+1)=$CHAR(31)
- +46 DO EN^XBVK("BGP")
- +47 QUIT
- +48 ;
- MUHOS(RETVAL,BGPSTR) ;sel measures by comm
- +1 SET X="MERR^BGP8GU"
- SET @^%ZOSF("TRAP")
- +2 NEW BGPI,BGPJ,BGPDATA,BGPDA,P,BGPERR,BGPCT,BGPOT,BGPOPT,BGPRT,P,R,A
- +3 NEW BGPTP,BGPQTR,BGPRDT,BGPRE,BGPBAS,BGPPATT,BGPLIST,BGPPRV,BGPPROV,BGPIND,BGPINDI,BGPLSTI
- +4 SET P="|"
- SET R="~"
- SET A="*"
- +5 IF $GET(BGPSTR)=""
- DO CATSTR(.BGPSTR,.BGPSTR)
- +6 SET BGPI=0
- +7 SET BGPERR=""
- +8 ;THIS WILL BE NULL AS WE DON'T NEED COMMUNITY TAXONOMY
- SET BGPCT=$PIECE($PIECE(BGPSTR,P),R)
- +9 ;Will be A, C, M, S for indicators selected
- SET BGPTP=$EXTRACT($PIECE(BGPSTR,P,2))
- +10 ; will be 1 for 90 days, 2 for one year (see BGPMUEP)
- SET BGPQTR=$PIECE(BGPSTR,P,3)
- +11 ;time to run the report
- SET BGPRDT=$PIECE(BGPSTR,P,4)
- +12 ;beginning date for report user entered e.g. 3110901
- SET BGPRE=$PIECE(BGPSTR,P,5)
- +13 SET BGPOPT="CRS 18 HOS MU REPORT"
- +14 ;BASE LINE YEAR IN 3000000 FORMAT (YEAR ONLY)
- SET BGPBAS=$PIECE(BGPSTR,P,6)
- +15 ;beneficiary
- SET BGPBEB=$PIECE(BGPSTR,P,7)
- +16 ; TYPE OF LIST: D Pts. Not in numerator N Pts in numerator A All Patients - THIS IS DIFFERENT THAN OUR REPORTS
- SET BGPLSTT=$PIECE(BGPSTR,P,8)
- +17 ;provider name they are running the report for
- SET BGPPRV=$PIECE($PIECE(BGPSTR,P,9),R)
- +18 ;provider ien they are running the report for
- SET BGPPROV=$PIECE($PIECE(BGPSTR,P,9),R,2)
- +19 ;output type D, P, B, X -NOTE: X IS XML - not sure how you will deal with this
- SET BGPOT=$PIECE(BGPSTR,P,10)
- +20 ;FILENAME
- SET BGPFN=$PIECE(BGPSTR,P,14)
- +21 ;string with indicators from BGPMU 11 MEASURES
- SET BGPINDI=$PIECE(BGPSTR,P,12)
- +22 ;will be null, we don't need MFI stuff
- SET BGPMFITI=$PIECE(BGPSTR,P,13)
- +23 ;list of measures from BGPMU 11 MEASURES.
- SET BGPLSTI=$PIECE(BGPSTR,P,11)
- +24 ;NOTE: BGPINDI IS only necessary if M or S is selected
- +25 NEW I
- +26 FOR I=2:1
- Begin DoDot:1
- +27 IF $PIECE(BGPLSTI,A,I)=""
- QUIT
- +28 NEW BGPL
- +29 SET BGPL=$PIECE($PIECE(BGPLSTI,A,I),R)
- +30 IF '$GET(BGPL)
- QUIT
- +31 SET BGPLIST(BGPL)=""
- End DoDot:1
- IF $PIECE(BGPLSTI,A,I)=""
- QUIT
- +32 NEW J
- +33 FOR J=2:1
- Begin DoDot:1
- +34 IF $PIECE(BGPINDI,A,J)=""
- QUIT
- +35 NEW BGPL
- +36 SET BGPL=$PIECE($PIECE(BGPINDI,A,J),R)
- +37 SET BGPIND(BGPL)=""
- End DoDot:1
- IF $PIECE(BGPINDI,A,J)=""
- QUIT
- +38 KILL ^BGPTMP($JOB)
- +39 SET RETVAL="^BGPTMP("_$JOB_")"
- +40 SET ^BGPTMP($JOB,BGPI)="T00250DATA"_$CHAR(30)
- +41 DO EP^BGP8GMUH(.BGPERR,DUZ,DUZ(2),BGPOPT,BGPCT,BGPTP,.BGPIND,BGPQTR,BGPRE,BGPBAS,$GET(BGPBEB),BGPLSTT,.BGPLIST,BGPPRV,BGPPROV,$GET(BGPOT),BGPRDT,BGPMFITI,BGPFN)
- +42 SET BGPI=BGPI+1
- +43 SET ^BGPTMP($JOB,BGPI)=+$GET(BGPERR)_$CHAR(30)
- +44 SET ^BGPTMP($JOB,BGPI+1)=$CHAR(31)
- +45 DO EN^XBVK("BGP")
- +46 QUIT
- +47 ;
- CATSTR(BGPSRET,STR) ;EP
- +1 NEW BGPDA
- +2 SET BGPSRET=""
- +3 SET BGPDA=0
- FOR
- SET BGPDA=$ORDER(STR(BGPDA))
- IF 'BGPDA
- QUIT
- Begin DoDot:1
- +4 SET BGPSRET=BGPSRET_$GET(STR(BGPDA))
- End DoDot:1
- +5 QUIT
- +6 ;