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

BGP2PESL.m

Go to the documentation of this file.
  1. BGP2PESL ; IHS/CMI/LAB - FY 06 DISPLAY IND LISTS ;
  1. ;;12.1;IHS CLINICAL REPORTING;;MAY 17, 2012;Build 66
  1. ;; ;
  1. RT ;EP
  1. ;for each measure list, choose report type
  1. W !!,"Select List Type.",!,"NOTE: If you select All Patients, your list may be",!,"hundreds of pages and take hours to print.",!
  1. S DIR(0)="S^R:Random Patient List;P:Patient List by Provider"_$S($G(BGPEDPP):";O:One Education Provider;E:Patient List by Education Provider",1:"")_";A:All Patients",DIR("A")="Choose report type for the Lists"
  1. S DIR("B")="R" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) S BGPQUIT="" K BGPLIST Q
  1. S BGPLIST=Y
  1. I BGPLIST="A" Q
  1. I BGPLIST="E" D Q
  1. .W !!,"Please Note: The education provider is obtained from the V Patient Ed File"
  1. .W !,"and is recorded with each topic. If the provider is not documented with the"
  1. .W !,"topic the provider listed in the report will be 'Unknown'.",!
  1. I BGPLIST="P" D G:BGPLPROV="" RT Q
  1. .S BGPLPROV="",BGPLPRV=""
  1. .S DIR(0)="9000001,.14",DIR("A")="Enter Designated Provider Name" KILL DA D ^DIR KILL DIR
  1. .I $D(DIRUT) Q
  1. .I Y="" Q
  1. .S BGPLPRV=+Y,BGPLPROV=Y(0,0)
  1. I BGPLIST="O" D G:BGPEPROV="" RT Q
  1. .S BGPEPROV="",BGPEPRV=""
  1. .S DIR(0)="9000001,.14",DIR("A")="Enter Education Provider Name" KILL DA D ^DIR KILL DIR
  1. .I $D(DIRUT) Q
  1. .I Y="" Q
  1. .S BGPEPRV=+Y,BGPEPROV=Y(0,0)
  1. .W !!,"Please Note: The education provider is obtained from the V Patient Ed File"
  1. .W !,"and is recorded with each topic. If the provider is not documented with the"
  1. .W !,"topic the topic/patient will not be listed on the patient list.",!
  1. Q
  1. EP ;EP - CALLED FROM OPTION
  1. D EN
  1. Q
  1. EOJ1 ;EP
  1. K BGPGLIST,BGPTIND,BGPHIGH,BGPANS,BGPC,BGPGANS,BGPGC,BGPGI,BGPI,BGPX
  1. Q
  1. ;; ;
  1. EN ;EP -- main entry point for GPRA LIST DISPLAY
  1. D EN^VALM("BGP 12 PATED LIST SELECTION")
  1. D CLEAR^VALM1
  1. D FULL^VALM1
  1. W:$D(IOF) @IOF
  1. D EOJ1
  1. Q
  1. ;
  1. HDR ; -- header code
  1. S VALMHDR(1)="IHS FY 11 Patient Education Performance Measure Lists of Patients"
  1. S VALMHDR(2)="* indicates the list has been selected"
  1. Q
  1. ;
  1. INIT ; -- init variables and list array
  1. K BGPGLIST,BGPNOLI S BGPHIGH=""
  1. S (X,C,I)=0 F S X=$O(BGPIND(X)) Q:X'=+X D
  1. .I $P(^BGPPEIW(X,0),U,4)]"" S C=C+1 D Q
  1. ..S BGPGLIST(C,0)=C_")",$E(BGPGLIST(C,0),5)=$P(^BGPPEIW(X,0),U,4),BGPGLIST("IDX",C,C)=X I $D(BGPLIST(X)) S BGPGLIST(C,0)="*"_BGPGLIST(C,0)
  1. .I $P(^BGPPEIW(X,0),U,4)="" S C=C+1 D
  1. ..S BGPGLIST(C,0)="NO patient list available for measure: "_$P(^BGPPEIW(X,0),U,2),BGPGLIST("IDX",C,C)=X,BGPNOLI(X)="" I $D(BGPLIST(X)) S BGPGLIST(C,0)="*"_BGPGLIST(C,0)
  1. S (VALMCNT,BGPHIGH)=C
  1. Q
  1. ;
  1. HELP ; -- help code
  1. S X="?" D DISP^XQORM1 W !!
  1. Q
  1. ;
  1. EXIT ; -- exit code
  1. Q
  1. ;
  1. EXPND ; -- expand code
  1. Q
  1. ;
  1. BACK ;go back to listman
  1. D TERM^VALM0
  1. S VALMBCK="R"
  1. D INIT
  1. D HDR
  1. K DIR
  1. K X,Y,Z,I
  1. Q
  1. ;
  1. ADD ;EP - add an item to the selected list - called from a protocol
  1. W ! S DIR(0)="LO^1:"_BGPHIGH,DIR("A")="Which item(s)" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I Y="" W !,"No items selected." G ADDX
  1. I $D(DIRUT) W !,"No items selected." G ADDX
  1. D FULL^VALM1 W:$D(IOF) @IOF
  1. S BGPGANS=Y,BGPGC="" F BGPGI=1:1 S BGPGC=$P(BGPGANS,",",BGPGI) Q:BGPGC="" S BGPI=$O(BGPGLIST("IDX",BGPGC,0)),BGPI=BGPGLIST("IDX",BGPGC,BGPI) I $D(BGPIND(BGPI)),'$D(BGPNOLI(BGPI)) S BGPLIST(BGPI)=""
  1. ADDX ;
  1. D BACK
  1. Q
  1. ADDALL ;
  1. F X=1:1:BGPHIGH S I=$G(BGPGLIST("IDX",X,X)) I $D(BGPIND(I)),'$D(BGPNOLI(I)) S BGPLIST(I)=""
  1. D BACK
  1. Q
  1. ;
  1. REM ;
  1. W ! S DIR(0)="LO^1:"_BGPHIGH,DIR("A")="Which item(s)" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I Y="" W !,"No items selected." G ADDX
  1. I $D(DIRUT) W !,"No items selected." G ADDX
  1. D FULL^VALM1 W:$D(IOF) @IOF
  1. S BGPGANS=Y,BGPGC="" F BGPGI=1:1 S BGPGC=$P(BGPGANS,",",BGPGI) Q:BGPGC="" K BGPLIST(BGPGC)
  1. REMX ;
  1. D BACK
  1. Q
  1. ;
  1. PT ;EP
  1. S (BGPROT,BGPDELT,BGPDELF)=""
  1. W !!,"Please choose an output type. For an explanation of the delimited",!,"file please see the user manual.",!
  1. S DIR(0)="S^P:Print Report on Printer or Screen;D:Create Delimited output file (for use in Excel);B:Both a Printed Report and Delimited File",DIR("A")="Select an Output Option",DIR("B")="P" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) Q
  1. S BGPROT=Y
  1. Q:BGPROT="P"
  1. S BGPDELF="",BGPDELT=""
  1. W !!,"You have selected to create a delimited output file. You can have this",!,"output file created as a text file in the pub directory, ",!,"OR you can have the delimited output display on your screen so that"
  1. W !,"you can do a file capture. Keep in mind that if you choose to",!,"do a screen capture you CANNOT Queue your report to run in the background!!",!!
  1. S DIR(0)="S^S:SCREEN - delimited output will display on screen for capture;F:FILE - delimited output will be written to a file in pub",DIR("A")="Select output type",DIR("B")="S" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G PT
  1. S BGPDELT=Y
  1. Q:BGPDELT="S"
  1. S DIR(0)="F^1:40",DIR("A")="Enter a filename for the delimited output (no more than 40 characters)" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G PT
  1. S BGPDELF=Y
  1. W !!,"When the report is finished your delimited output will be found in the",!,$$GETDEDIR^BGP2UTL2()," directory. The filename will be ",BGPDELF,".txt",!
  1. Q