PXRMCQIN ;SLC/PKR - Clinical quality measure inquiry for general use. ;11/19/2014
;;2.0;CLINICAL REMINDERS;**47**;Feb 04, 2005;Build 291
;==========================================
BMINQALL ;Clinical quality measure inquiry, return the formatted text OUTPUT.
N BOP,INQTYPE,MIEN,NAME,OUTPUT
S INQTYPE=$$GTYPE
S BOP=$$BORP^PXRMUTIL("B")
I BOP="" Q
S NAME=""
F S NAME=$O(^PXRM(802.3,"B",NAME)) Q:NAME="" D
. S MIEN=$O(^PXRM(802.3,"B",NAME,""))
. D CQMINQ(INQTYPE,MIEN,.OUTPUT)
. I BOP="B" D BROWSE^DDBR("OUTPUT","NR","Clinical Quality Measure Inquiry")
. I BOP="P" D GPRINT^PXRMUTIL("OUTPUT")
Q
;
;==========================================
BMINQ(MIEN) ;Display a clinical quality measure inquiry, defaults to the Browswer.
N BOP,DIR0,INQTYPE,OUTPUT,TITLE
I '$D(^PXRM(802.3,MIEN)) Q
S INQTYPE=$$GTYPE
S TITLE="Clinical Quality Measure Inquiry - "_$S(INQTYPE="C":"Condensed",INQTYPE="F":"Full",1:"")
D CQMINQ(INQTYPE,MIEN,.OUTPUT)
S BOP=$$BORP^PXRMUTIL("B")
I BOP="" Q
I BOP="B" D BROWSE^DDBR("OUTPUT","NR",TITLE)
I BOP="P" D GPRINT^PXRMUTIL("OUTPUT")
Q
;
;==========================================
CQMINQ(INQTYPE,MIEN,OUTPUT) ;Clinical quality measure inquiry, return the
;formatted text OUTPUT. Use 80 column output.
N CHDR,CODESYSN,CODESYSP,DUPL,IENSTR,IND,OCL,NL
N LEXSAB,MNAME,NCODES,NCODESA,NCS,NOUT,NPAD,NUCODES,RM
N TCODES,TEMP,TERM,TEXT,TEXTOUT
S RM=80
D MHDR(RM,IEN,.NL,.OUTPUT)
I INQTYPE="F" D MLISTF(MIEN,.NL,.OUTPUT)
S NL=NL+1,OUTPUT(NL)=""
S NL=NL+1,OUTPUT(NL)="Value sets used in this measure:"
I INQTYPE="C" D VSLISTC(MIEN,.NL,.OUTPUT)
I INQTYPE="F" D VSLISTF(MIEN,.NL,.OUTPUT)
Q
;
;==========================================
GTYPE() ;Prompt the user for the type of output.
N DIR,POP,X,Y
S DIR(0)="SA"_U_"C:Condensed;F:Full"
S DIR("A")="Condensed or full inquiry? "
S DIR("B")="C"
D ^DIR
I $D(DIROUT) S DTOUT=1
I $D(DTOUT)!($D(DUOUT)) Q "F"
Q Y
;
;==========================================
MHDR(RM,MIEN,NL,OUTPUT) ;Produce the measure header text.
N IENSTR,NIN,NOUT,NPAD,TEMP,TEXT,TEXTIN,TEXTOUT
S IENSTR="No. "_IEN
S TEMP=$$REPEAT^XLFSTR("-",RM)
S OUTPUT(1)=TEMP
S TEXT=$P(^PXRM(802.3,IEN,0),U,1)
D FORMATS^PXRMTEXT(1,70,TEXT,.NOUT,.TEXTOUT)
S NPAD=RM-$L(TEXTOUT(1))-1
S OUTPUT(2)=TEXTOUT(1)_$$RJ^XLFSTR(IENSTR,NPAD," ")
S NL=2
I NOUT>1 F IND=2:1:NOUT S NL=NL+1,OUTPUT(NL)=TEXTOUT(IND)
S NL=NL+1,OUTPUT(NL)=TEMP
S TEMP=^PXRM(802.3,MIEN,1)
S NL=NL+1,OUTPUT(NL)=" CMS ID: "_$P(TEMP,U,1)
S NL=NL+1,OUTPUT(NL)=" Version number: "_$P(TEMP,U,2)
S NL=NL+1,OUTPUT(NL)=" GUID: "_$P(TEMP,U,3)
S NL=NL+1,OUTPUT(NL)=" NQF number: "_$P(TEMP,U,4)
S NL=NL+1,OUTPUT(NL)=""
K TEXTIN,TEXTOUT
S NIN=$P(^PXRM(802.3,MIEN,2,0),U,3)
S TEXTIN(1)="Description: "_^PXRM(802.3,MIEN,2,1,0)
F IND=2:1:NIN S TEXTIN(IND)=^PXRM(802.3,MIEN,2,IND,0)
D FORMAT^PXRMTEXT(2,78,NIN,.TEXTIN,.NOUT,.TEXTOUT)
F IND=1:1:NOUT S NL=NL+1,OUTPUT(NL)=TEXTOUT(IND)
Q
;
;==========================================
MLISTF(MIEN,NL,OUTPUT) ;Produce the full measure list.
N IND,NIN,NOUT,STEWARD,NUM,TEMP,TEXTIN,TEXTOUT,VSIEN,VSNAME
S TEXTIN="Steward: "_$G(^PXRM(802.3,MIEN,5))
D FORMATS^PXRMTEXT(3,78,TEXTIN,.NOUT,.TEXTOUT)
F IND=1:1:NOUT S NL=NL+1,OUTPUT(NL)=TEXTOUT(IND)
K TEXTIN,TEXTOUT
S TEMP=^PXRM(802.3,MIEN,3)
S NL=NL+1,OUTPUT(NL)=""
S NL=NL+1,OUTPUT(NL)=" Category: "_$P(TEMP,U,1)
S NL=NL+1,OUTPUT(NL)=" Identifier: "_$P(TEMP,U,2)
S NL=NL+1,OUTPUT(NL)=" Status: "_$P(TEMP,U,3)
S NL=NL+1,OUTPUT(NL)=" Type: "_$P(TEMP,U,4)
S NL=NL+1,OUTPUT(NL)=" Measure Set: "_$P(TEMP,U,5)
S NL=NL+1,OUTPUT(NL)=" Sheetname: "_$P(TEMP,U,6)
Q
;
;==========================================
VSLIST(MIEN,NVS,VSLIST) ;Build a list of value sets used by a measure.
N IND,VSIEN,VSNAME,VSOID,VSVDATE
S (IND,NVS)=0
F S IND=+$O(^PXRM(802.3,MIEN,7,IND)) Q:IND=0 D
. S NVS=NVS+1
. S VSOID=$P(^PXRM(802.3,MIEN,7,IND,0),U,1)
. S VSVDATE=$P(^PXRM(802.3,MIEN,7,IND,0),U,2)
. S VSIEN=$O(^PXRM(802.2,"OID",VSOID,""))
. S VSNAME=$P(^PXRM(802.2,VSIEN,0),U,1)
. S VSLIST(NVS)=VSNAME_U_VSOID_U_VSVDATE
Q
;
;==========================================
VSLISTC(MIEN,NL,OUTPUT) ;Produce the condensed value set list.
N FMTSTR,IND,JND,NOUT,NVS,TEXTIN,TEXTOUT,VSLIST
S FMTSTR="5R2^72L"
D VSLIST(MIEN,.NVS,.VSLIST)
F IND=1:1:NVS D
. S TEXTIN=IND_".^"_$P(VSLIST(IND),U,1)
. D COLFMT^PXRMTEXT(FMTSTR,TEXTIN," ",.NOUT,.TEXTOUT)
. F JND=1:1:NOUT S NL=NL+1,OUTPUT(NL)=TEXTOUT(JND)
Q
;
;==========================================
VSLISTF(MIEN,NL,OUTPUT) ;Produce the full value set list.
N FMTSTR,IND,JND,NVS,NOUT,TEXTIN,TEXTOUT,VSLIST
S FMTSTR="5R2^72L"
D VSLIST(MIEN,.NVS,.VSLIST)
F IND=1:1:NVS D
. S TEXTIN=IND_".^"_$P(VSLIST(IND),U,1)
. D COLFMT^PXRMTEXT(FMTSTR,TEXTIN," ",.NOUT,.TEXTOUT)
. F JND=1:1:NOUT S NL=NL+1,OUTPUT(NL)=TEXTOUT(JND)
. S NL=NL+1,OUTPUT(NL)=" OID: "_$P(VSLIST(IND),U,2)
. S NL=NL+1,OUTPUT(NL)=" Version Date: "_$$FMTE^XLFDT($P(VSLIST(IND),U,3))
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXRMCQIN 5074 printed Nov 22, 2024@16:53:31 Page 2
PXRMCQIN ;SLC/PKR - Clinical quality measure inquiry for general use. ;11/19/2014
+1 ;;2.0;CLINICAL REMINDERS;**47**;Feb 04, 2005;Build 291
+2 ;==========================================
BMINQALL ;Clinical quality measure inquiry, return the formatted text OUTPUT.
+1 NEW BOP,INQTYPE,MIEN,NAME,OUTPUT
+2 SET INQTYPE=$$GTYPE
+3 SET BOP=$$BORP^PXRMUTIL("B")
+4 IF BOP=""
QUIT
+5 SET NAME=""
+6 FOR
SET NAME=$ORDER(^PXRM(802.3,"B",NAME))
if NAME=""
QUIT
Begin DoDot:1
+7 SET MIEN=$ORDER(^PXRM(802.3,"B",NAME,""))
+8 DO CQMINQ(INQTYPE,MIEN,.OUTPUT)
+9 IF BOP="B"
DO BROWSE^DDBR("OUTPUT","NR","Clinical Quality Measure Inquiry")
+10 IF BOP="P"
DO GPRINT^PXRMUTIL("OUTPUT")
End DoDot:1
+11 QUIT
+12 ;
+13 ;==========================================
BMINQ(MIEN) ;Display a clinical quality measure inquiry, defaults to the Browswer.
+1 NEW BOP,DIR0,INQTYPE,OUTPUT,TITLE
+2 IF '$DATA(^PXRM(802.3,MIEN))
QUIT
+3 SET INQTYPE=$$GTYPE
+4 SET TITLE="Clinical Quality Measure Inquiry - "_$SELECT(INQTYPE="C":"Condensed",INQTYPE="F":"Full",1:"")
+5 DO CQMINQ(INQTYPE,MIEN,.OUTPUT)
+6 SET BOP=$$BORP^PXRMUTIL("B")
+7 IF BOP=""
QUIT
+8 IF BOP="B"
DO BROWSE^DDBR("OUTPUT","NR",TITLE)
+9 IF BOP="P"
DO GPRINT^PXRMUTIL("OUTPUT")
+10 QUIT
+11 ;
+12 ;==========================================
CQMINQ(INQTYPE,MIEN,OUTPUT) ;Clinical quality measure inquiry, return the
+1 ;formatted text OUTPUT. Use 80 column output.
+2 NEW CHDR,CODESYSN,CODESYSP,DUPL,IENSTR,IND,OCL,NL
+3 NEW LEXSAB,MNAME,NCODES,NCODESA,NCS,NOUT,NPAD,NUCODES,RM
+4 NEW TCODES,TEMP,TERM,TEXT,TEXTOUT
+5 SET RM=80
+6 DO MHDR(RM,IEN,.NL,.OUTPUT)
+7 IF INQTYPE="F"
DO MLISTF(MIEN,.NL,.OUTPUT)
+8 SET NL=NL+1
SET OUTPUT(NL)=""
+9 SET NL=NL+1
SET OUTPUT(NL)="Value sets used in this measure:"
+10 IF INQTYPE="C"
DO VSLISTC(MIEN,.NL,.OUTPUT)
+11 IF INQTYPE="F"
DO VSLISTF(MIEN,.NL,.OUTPUT)
+12 QUIT
+13 ;
+14 ;==========================================
GTYPE() ;Prompt the user for the type of output.
+1 NEW DIR,POP,X,Y
+2 SET DIR(0)="SA"_U_"C:Condensed;F:Full"
+3 SET DIR("A")="Condensed or full inquiry? "
+4 SET DIR("B")="C"
+5 DO ^DIR
+6 IF $DATA(DIROUT)
SET DTOUT=1
+7 IF $DATA(DTOUT)!($DATA(DUOUT))
QUIT "F"
+8 QUIT Y
+9 ;
+10 ;==========================================
MHDR(RM,MIEN,NL,OUTPUT) ;Produce the measure header text.
+1 NEW IENSTR,NIN,NOUT,NPAD,TEMP,TEXT,TEXTIN,TEXTOUT
+2 SET IENSTR="No. "_IEN
+3 SET TEMP=$$REPEAT^XLFSTR("-",RM)
+4 SET OUTPUT(1)=TEMP
+5 SET TEXT=$PIECE(^PXRM(802.3,IEN,0),U,1)
+6 DO FORMATS^PXRMTEXT(1,70,TEXT,.NOUT,.TEXTOUT)
+7 SET NPAD=RM-$LENGTH(TEXTOUT(1))-1
+8 SET OUTPUT(2)=TEXTOUT(1)_$$RJ^XLFSTR(IENSTR,NPAD," ")
+9 SET NL=2
+10 IF NOUT>1
FOR IND=2:1:NOUT
SET NL=NL+1
SET OUTPUT(NL)=TEXTOUT(IND)
+11 SET NL=NL+1
SET OUTPUT(NL)=TEMP
+12 SET TEMP=^PXRM(802.3,MIEN,1)
+13 SET NL=NL+1
SET OUTPUT(NL)=" CMS ID: "_$PIECE(TEMP,U,1)
+14 SET NL=NL+1
SET OUTPUT(NL)=" Version number: "_$PIECE(TEMP,U,2)
+15 SET NL=NL+1
SET OUTPUT(NL)=" GUID: "_$PIECE(TEMP,U,3)
+16 SET NL=NL+1
SET OUTPUT(NL)=" NQF number: "_$PIECE(TEMP,U,4)
+17 SET NL=NL+1
SET OUTPUT(NL)=""
+18 KILL TEXTIN,TEXTOUT
+19 SET NIN=$PIECE(^PXRM(802.3,MIEN,2,0),U,3)
+20 SET TEXTIN(1)="Description: "_^PXRM(802.3,MIEN,2,1,0)
+21 FOR IND=2:1:NIN
SET TEXTIN(IND)=^PXRM(802.3,MIEN,2,IND,0)
+22 DO FORMAT^PXRMTEXT(2,78,NIN,.TEXTIN,.NOUT,.TEXTOUT)
+23 FOR IND=1:1:NOUT
SET NL=NL+1
SET OUTPUT(NL)=TEXTOUT(IND)
+24 QUIT
+25 ;
+26 ;==========================================
MLISTF(MIEN,NL,OUTPUT) ;Produce the full measure list.
+1 NEW IND,NIN,NOUT,STEWARD,NUM,TEMP,TEXTIN,TEXTOUT,VSIEN,VSNAME
+2 SET TEXTIN="Steward: "_$GET(^PXRM(802.3,MIEN,5))
+3 DO FORMATS^PXRMTEXT(3,78,TEXTIN,.NOUT,.TEXTOUT)
+4 FOR IND=1:1:NOUT
SET NL=NL+1
SET OUTPUT(NL)=TEXTOUT(IND)
+5 KILL TEXTIN,TEXTOUT
+6 SET TEMP=^PXRM(802.3,MIEN,3)
+7 SET NL=NL+1
SET OUTPUT(NL)=""
+8 SET NL=NL+1
SET OUTPUT(NL)=" Category: "_$PIECE(TEMP,U,1)
+9 SET NL=NL+1
SET OUTPUT(NL)=" Identifier: "_$PIECE(TEMP,U,2)
+10 SET NL=NL+1
SET OUTPUT(NL)=" Status: "_$PIECE(TEMP,U,3)
+11 SET NL=NL+1
SET OUTPUT(NL)=" Type: "_$PIECE(TEMP,U,4)
+12 SET NL=NL+1
SET OUTPUT(NL)=" Measure Set: "_$PIECE(TEMP,U,5)
+13 SET NL=NL+1
SET OUTPUT(NL)=" Sheetname: "_$PIECE(TEMP,U,6)
+14 QUIT
+15 ;
+16 ;==========================================
VSLIST(MIEN,NVS,VSLIST) ;Build a list of value sets used by a measure.
+1 NEW IND,VSIEN,VSNAME,VSOID,VSVDATE
+2 SET (IND,NVS)=0
+3 FOR
SET IND=+$ORDER(^PXRM(802.3,MIEN,7,IND))
if IND=0
QUIT
Begin DoDot:1
+4 SET NVS=NVS+1
+5 SET VSOID=$PIECE(^PXRM(802.3,MIEN,7,IND,0),U,1)
+6 SET VSVDATE=$PIECE(^PXRM(802.3,MIEN,7,IND,0),U,2)
+7 SET VSIEN=$ORDER(^PXRM(802.2,"OID",VSOID,""))
+8 SET VSNAME=$PIECE(^PXRM(802.2,VSIEN,0),U,1)
+9 SET VSLIST(NVS)=VSNAME_U_VSOID_U_VSVDATE
End DoDot:1
+10 QUIT
+11 ;
+12 ;==========================================
VSLISTC(MIEN,NL,OUTPUT) ;Produce the condensed value set list.
+1 NEW FMTSTR,IND,JND,NOUT,NVS,TEXTIN,TEXTOUT,VSLIST
+2 SET FMTSTR="5R2^72L"
+3 DO VSLIST(MIEN,.NVS,.VSLIST)
+4 FOR IND=1:1:NVS
Begin DoDot:1
+5 SET TEXTIN=IND_".^"_$PIECE(VSLIST(IND),U,1)
+6 DO COLFMT^PXRMTEXT(FMTSTR,TEXTIN," ",.NOUT,.TEXTOUT)
+7 FOR JND=1:1:NOUT
SET NL=NL+1
SET OUTPUT(NL)=TEXTOUT(JND)
End DoDot:1
+8 QUIT
+9 ;
+10 ;==========================================
VSLISTF(MIEN,NL,OUTPUT) ;Produce the full value set list.
+1 NEW FMTSTR,IND,JND,NVS,NOUT,TEXTIN,TEXTOUT,VSLIST
+2 SET FMTSTR="5R2^72L"
+3 DO VSLIST(MIEN,.NVS,.VSLIST)
+4 FOR IND=1:1:NVS
Begin DoDot:1
+5 SET TEXTIN=IND_".^"_$PIECE(VSLIST(IND),U,1)
+6 DO COLFMT^PXRMTEXT(FMTSTR,TEXTIN," ",.NOUT,.TEXTOUT)
+7 FOR JND=1:1:NOUT
SET NL=NL+1
SET OUTPUT(NL)=TEXTOUT(JND)
+8 SET NL=NL+1
SET OUTPUT(NL)=" OID: "_$PIECE(VSLIST(IND),U,2)
+9 SET NL=NL+1
SET OUTPUT(NL)=" Version Date: "_$$FMTE^XLFDT($PIECE(VSLIST(IND),U,3))
End DoDot:1
+10 QUIT
+11 ;