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

BDMRML.m

Go to the documentation of this file.
  1. BDMRML ; IHS/CMI/LAB - patients w/o dm on problem list ; 28 Nov 2017 1:25 PM
  1. ;;2.0;DIABETES MANAGEMENT SYSTEM;**9,10,11**;JUN 14, 2007;Build 30
  1. ;
  1. ;
  1. START ;
  1. D INFORM
  1. GETINFO ;
  1. K BDMSTAT
  1. R ;
  1. S BDMREG=""
  1. S DIC="^ACM(41.1,",DIC(0)="AEMQ",DIC("A")="Enter the Name of the Register: " D ^DIC
  1. I Y=-1 W !,"No register selected." S BDMQUIT="" D EXIT Q
  1. S BDMREG=+Y
  1. RS ;get status
  1. K BDMSTAT
  1. S DIR(0)="Y",DIR("A")="Do you want to select register patients with a particular status",DIR("B")="Y" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G R
  1. I Y=0 K BDMSTAT G AGE
  1. R1 ;which status
  1. S DIR(0)="9002241,1O",DIR("A")="Select "_$S($D(BDMSTAT):"another ",1:"")_"status" S:'$D(BDMSTAT) DIR("B")="A" KILL DA D ^DIR KILL DIR
  1. I Y="",'$D(BDMSTAT) G RS
  1. I $D(DIRUT),'$D(BDMSTAT) G RS
  1. I $D(DIRUT) G AGE
  1. I Y="" G AGE
  1. S BDMSTAT(Y)=""
  1. G R1
  1. AGE ;Age Screening
  1. K BDMAGE,BDMAGET
  1. W ! S DIR(0)="YO",DIR("A")="Would you like to restrict the master list by Patient age range",DIR("B")="NO"
  1. S DIR("?")="If you wish to include patients from ALL age ranges, anwser No. If you wish to list only patients within a particular age range, enter Yes."
  1. D ^DIR K DIR
  1. G:$D(DIRUT) RS
  1. I 'Y G CMMNTS
  1. ;
  1. AGER ;Age Screening
  1. W !
  1. S DIR(0)="FO^1:7",DIR("A")="Enter an Age Range (e.g. 5-12,1-1)" D ^DIR
  1. I Y="" W !!,"No age range entered." G AGE
  1. I Y'?1.3N1"-"1.3N W !!,$C(7),$C(7),"Enter a numeric range in the format nnn-nnn. e.g. 0-5, 0-99, 5-20." G AGER
  1. S BDMAGET=Y
  1. CMMNTS ;
  1. K BDMCOMM S BDMCOMT=""
  1. S DIR(0)="S^O:One particular Community;A:All Communities;S:Selected Set of Communities (Taxonomy)",DIR("A")="Include Patients",DIR("B")="A" K DA D ^DIR K DIR
  1. I $D(DIRUT) G AGE
  1. S BDMCOMT=Y
  1. I BDMCOMT="A" G SEX
  1. I BDMCOMT="O" D G:'$D(BDMCOMM) CMMNTS G SEX
  1. .S DIC="^AUTTCOM(",DIC(0)="AEMQ",DIC("A")="Which COMMUNITY: " D ^DIC K DIC
  1. .Q:Y=-1
  1. .S BDMCOMM($P(^AUTTCOM(+Y,0),U))=""
  1. S X="COMMUNITY",DIC="^AMQQ(5,",DIC(0)="FM",DIC("S")="I $P(^(0),U,14)" D ^DIC K DIC,DA I Y=-1 W "OOPS - QMAN NOT CURRENT - QUITTING" S BDMERR=1 Q
  1. D PEP^AMQQGTX0(+Y,"BDMCOMM(")
  1. I '$D(BDMCOMM) G CMMNTS
  1. I $D(BDMCOMM("*")) W !,"* ISN'T ALLOWED, CHOOSE ALL" K BDMCOMM G CMMNTS
  1. SEX ;
  1. S BDMSEX=""
  1. S DIR(0)="S^M:MALES;F:FEMALES;U:UNKNOWN;A:ALL Genders",DIR("A")="Include which Gender(s)",DIR("B")="A" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G CMMNTS
  1. S BDMSEX=Y
  1. CM ;
  1. K BDMCM
  1. S DIR(0)="Y",DIR("A")="Do you want to select register patients with a particular CASE MANAGER",DIR("B")="N" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G SEX
  1. I Y=0 K BDMCM G WF
  1. CM1 ;which status
  1. K DIC S DIC(0)="AEMQ",DIC=200,DIC("A")="Select "_$S($D(BDMCM):"another ",1:"")_"Case Manager: " D ^DIC K DIC
  1. I Y=-1,'$D(BDMCM) G CM
  1. I $D(DIRUT),'$D(BDMCM) G CM
  1. I $D(DIRUT) G WF
  1. I Y=-1 G WF
  1. S BDMCM(+Y)=""
  1. G CM1
  1. WF ;
  1. K BDMWF
  1. S DIR(0)="Y",DIR("A")="Do you want to select patients with a particular facility WHERE FOLLOWED",DIR("B")="N" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G CM
  1. I Y=0 K BDMWF G SORT
  1. WF1 ;which status
  1. ;ihs/cmi/maw 03/12/2014 2.0 patch 8 added DIC(0) call
  1. K DIC S DIC=9999999.06,DIC(0)="AEMQZ",DIC("A")="Select "_$S($D(BDMWF):"another ",1:"")_"WHERE FOLLOWED facility: " D ^DIC K DIC
  1. I Y=-1,'$D(BDMWF) G WF
  1. I $D(DIRUT),'$D(BDMWF) G WF
  1. I $D(DIRUT) G SORT
  1. I Y=-1 G SORT
  1. S BDMWF(+Y)=""
  1. G WF1
  1. SORT ;
  1. S BDMSORT1="",BDMSORT2=""
  1. W !!,"This list can be sorted by a primary and optionally a secondary sort value.",!
  1. S DIR(0)="S^P:Patient Name;S:Register Status;A:Age;C:Community;G:Gender;M:Case Manager;W:Where Followed",DIR("A")="Select Primary Sort Value" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G WF
  1. S BDMSORT1=Y,BDMSOR1T=Y(0)
  1. SSORT ;
  1. W !,"You can optionally sort by a second sort value. If you do not pick a",!,"secondary sort value it will default to patient name.",!
  1. S BDMSORT2=""
  1. K DIR
  1. S DIR(0)="SO^"_$S(BDMSORT1'="P":"P:Patient Name",1:"")
  1. S DIR(0)=DIR(0)_$S(BDMSORT1'="S":";S:Register Status",1:"")
  1. S DIR(0)=DIR(0)_$S(BDMSORT1'="A":";A:Age",1:"")
  1. S DIR(0)=DIR(0)_$S(BDMSORT1'="C":";C:Community",1:"")
  1. S DIR(0)=DIR(0)_$S(BDMSORT1'="G":";G:Gender",1:"")
  1. S DIR(0)=DIR(0)_$S(BDMSORT1'="M":";M:Case Manager",1:"")
  1. S DIR(0)=DIR(0)_$S(BDMSORT1'="W":";W:Where Followed",1:"")
  1. S DIR("A")="Select Secondary Sort Value" KILL DA D ^DIR KILL DIR
  1. I X="" S BDMSORT2="P",BDMSOR2T="Patient Name" G TEMP
  1. I $D(DIRUT) G SORT
  1. S BDMSORT2=Y,BDMSOR2T=Y(0)
  1. ;I BDMSORT2="" S BDMSORT2="P",BDMSOR2T="Patient Name"
  1. TEMP ;
  1. S BDMTEMP=""
  1. S DIR(0)="S^P:Print the List;B:Browse the List on the Screen;S:Save as a Search Template",DIR("A")="Output Type",DIR("B")="P" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G SORT
  1. S BDMTEMP=Y
  1. I BDMTEMP="P" G ZIS
  1. I BDMTEMP="B" G ZIS
  1. D EN2
  1. I BDMSTMP="" G TEMP
  1. ZIS ;call to XBDBQUE
  1. DEMO ;
  1. D DEMOCHK^BDMUTL(.BDMDEMO)
  1. I BDMDEMO=-1 G R
  1. I BDMTEMP="B" D BROWSE,EXIT Q
  1. S XBRP="PRINT^BDMRML",XBRC="PROC^BDMRML",XBRX="EXIT^BDMRML",XBNS="BDM"
  1. D ^XBDBQUE
  1. D EXIT
  1. Q
  1. BROWSE ;
  1. S XBRP="VIEWR^XBLM(""PRINT^BDMRML"")"
  1. S XBRC="PROC^BDMRML",XBRX="EXIT^BDMRML",XBIOP=0 D ^XBDBQUE
  1. Q
  1. INFORM ;
  1. W:$D(IOF) @IOF
  1. W !,$$CTR($$LOC)
  1. W !,$$CTR($$USR)
  1. W !!,$$CTR("DIABETES REGISTER MASTER LIST",80)
  1. W !!,"This report will list all patients on the Diabetes Register.",!
  1. W "You will be able to select which patients will be included on the list",!
  1. W "based on any of the following:",!
  1. W ?5,"- Register Status",!
  1. W ?5,"- Age",!
  1. W ?5,"- Community of Residence",!
  1. W ?5,"- Gender",!
  1. W ?5,"- Case Manager",!
  1. W ?5,"- Where Followed",!
  1. W !
  1. Q
  1. EXIT ;clean up and exit
  1. I '$D(BDMGUI) D EN^XBVK("BDM")
  1. D ^XBFMK
  1. D KILL^AUPNPAT
  1. Q
  1. PROC ;EP - called from XBDBQUE
  1. S BDMJOB=$J,BDMBTH=$H,BDMTOT=0
  1. K BDMSORT
  1. K ^XTMP("BDMRML",BDMJOB,BDMBTH)
  1. D XTMP^BDMOSUT("BDMRML","DM MASTER LIST")
  1. S BDMX=0 F S BDMX=$O(^ACM(41,"B",BDMREG,BDMX)) Q:BDMX'=+BDMX D
  1. .S DFN=$P(^ACM(41,BDMX,0),U,2)
  1. .Q:$$DEMO^BDMUTL(DFN,$G(BDMDEMO))
  1. .Q:$$DOD^AUPNPAT(DFN)]""
  1. .I $D(BDMSTAT) S X=$P($G(^ACM(41,BDMX,"DT")),U,1) Q:X="" Q:'$D(BDMSTAT(X))
  1. .I $D(BDMAGET) Q:$$AGE^AUPNPAT(DFN)>$P(BDMAGET,"-",2)
  1. .I $D(BDMAGET) Q:$$AGE^AUPNPAT(DFN)<$P(BDMAGET,"-",1)
  1. .I $D(BDMCOMM) S X=$P($G(^AUPNPAT(DFN,11)),U,18) Q:X="" I X]"",'$D(BDMCOMM(X)) Q
  1. .I BDMSEX'="A" S X=$$GET1^DIQ(2,DFN,.02,"I") I BDMSEX'=X Q
  1. .I $D(BDMCM) S X=$$VALI^XBDIQ1(9002241,BDMX,6) Q:'X I X Q:'$D(BDMCM(X))
  1. .I $D(BDMWF) S X=$$VALI^XBDIQ1(9002241,BDMX,10) Q:'X I X Q:'$D(BDMWF(X))
  1. .D @BDMSORT1
  1. .S BDMS1=X
  1. .D @BDMSORT2
  1. .S BDMS2=X
  1. .S ^XTMP("BDMRML",BDMJOB,BDMBTH,"PATIENTS",BDMS1,BDMS2,BDMX)=DFN
  1. .I BDMSORT1'="P" S BDMSORT(BDMS1)=$G(BDMSORT(BDMS1))+1 ;SUBOTOTAL
  1. .S BDMTOT=BDMTOT+1
  1. Q
  1. PRINT ;EP - called from xbdbque
  1. S BDMIOSL=$S($G(BDMGUI):55,1:IOSL)
  1. S BDM80D="-------------------------------------------------------------------------------"
  1. S BDMPG=0 D HEAD
  1. I '$D(^XTMP("BDMRML",BDMJOB,BDMBTH)) W !!,"NO PATIENTS TO REPORT" G DONE
  1. S BDMS1="",BDMS2="" K BDMQ
  1. F S BDMS1=$O(^XTMP("BDMRML",BDMJOB,BDMBTH,"PATIENTS",BDMS1)) Q:BDMS1=""!($D(BDMQ)) D
  1. .I $Y>(IOSL-3) D HEAD Q:$D(BDMQ)
  1. .I BDMTEMP'="S",BDMSORT1'="P" W !!?5,BDMSOR1T,": ",BDMS1," (Subtotal: ",BDMSORT(BDMS1),")"
  1. .S BDMS2="" F S BDMS2=$O(^XTMP("BDMRML",BDMJOB,BDMBTH,"PATIENTS",BDMS1,BDMS2)) Q:BDMS2=""!($D(BDMQ)) D
  1. ..S BDMX="" F S BDMX=$O(^XTMP("BDMRML",BDMJOB,BDMBTH,"PATIENTS",BDMS1,BDMS2,BDMX)) Q:BDMX=""!($D(BDMQ)) D
  1. ...S DFN=^XTMP("BDMRML",BDMJOB,BDMBTH,"PATIENTS",BDMS1,BDMS2,BDMX)
  1. ...I BDMTEMP="S" S ^DIBT(BDMSTMP,1,DFN)="" Q
  1. ...I $Y>(BDMIOSL-4) D HEAD Q:$D(BDMQ)
  1. ...W !,$$HRN^AUPNPAT(DFN,$S($G(BDMDUZ2):BDMDUZ2,1:DUZ(2))),?8,$E($P(^DPT(DFN,0),U,1),1,20),?30,$E($$GET1^DIQ(9002241,BDMX,6),1,15)
  1. ...W ?48,$$LASTVD(DFN),?59,$$DATE($$GET1^DIQ(9002241,BDMX,8,"I")),?70,$$DATE($$GET1^DIQ(9002241,BDMX,9,"I"))
  1. DONE ;
  1. I BDMTEMP="S" D HDR
  1. I $E(IOST)="C",IO=IO(0) S DIR(0)="EO",DIR("A")="End of report. HIT RETURN" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. W:$D(IOF) @IOF
  1. K ^XTMP("BDMRML",BDMJOB,BDMBTH),BDMJOB,BDMBTH
  1. Q
  1. DATE(D) ;
  1. I D="" Q ""
  1. Q $E(D,4,5)_"/"_$E(D,6,7)_"/"_$E(D,2,3)
  1. LASTVD(P) ;
  1. NEW X,Y,Z,V,D
  1. S V=""
  1. S D=0 F S D=$O(^AUPNVSIT("AA",P,D)) Q:D'=+D!(V) D
  1. .S X=0 F S X=$O(^AUPNVSIT("AA",P,D,X)) Q:X'=+X!(V) D
  1. ..Q:'$D(^AUPNVSIT(X,0))
  1. ..Q:$P(^AUPNVSIT(X,0),U,11) ;deleted
  1. ..Q:'$P(^AUPNVSIT(X,0),U,9) ;ZERO DEP
  1. ..Q:"CTNEDX"[$P(^AUPNVSIT(X,0),U,7)
  1. ..S V=X
  1. I V="" Q ""
  1. S D=$$VD^APCLV(V)
  1. Q $$DATE($$VD^APCLV(V))
  1. I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S BDMQ="" Q
  1. HEAD1 ;
  1. W:$D(IOF) @IOF S BDMPG=BDMPG+1
  1. I $G(BDMGUI),BDMPG'=1 W !,"ZZZZZZZ"
  1. W !?13,"********** CONFIDENTIAL PATIENT INFORMATION **********"
  1. W !,$P(^VA(200,DUZ,0),U,2),?72,"Page ",BDMPG,!
  1. W ?(80-$L($P(^DIC(4,$S($G(BDMDUZ2):BDMDUZ2,1:DUZ(2)),0),U))/2),$P(^DIC(4,$S($G(BDMDUZ2):BDMDUZ2,1:DUZ(2)),0),U),!
  1. W $$CTR("DIABETES REGISTER MASTER LIST",80),!
  1. W $$CTR("Total number of patient selected for this report: "_BDMTOT),!
  1. W !?48,"LAST",?60,"LAST",?70,"NEXT"
  1. PIH W !,"HRN",?8,"PATIENT",?30,"CASE MANAGER",?48,"VISIT",?60,"REVIEW",?70,"REVIEW",!,BDM80D,!
  1. Q
  1. CTR(X,Y) ;EP - Center X in a field Y wide.
  1. Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
  1. ;----------
  1. EOP ;EP - End of page.
  1. Q:$E(IOST)'="C"
  1. Q:$D(ZTQUEUED)!'(IOT="TRM")!$D(IO("S"))
  1. NEW DIR
  1. K DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
  1. S DIR(0)="E" D ^DIR
  1. Q
  1. ;----------
  1. USR() ;EP - Return name of current user from ^VA(200.
  1. Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
  1. ;----------
  1. LOC() ;EP - Return location name from file 4 based on DUZ(2).
  1. Q $S($G(DUZ(2)):$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
  1. ;----------
  1. P ;
  1. S X=$P(^DPT(DFN,0),U,1)
  1. Q
  1. S ;
  1. S X=$$GET1^DIQ(9002241,BDMX,1)
  1. I X="" S X="<NONE>"
  1. Q
  1. A ;
  1. S X=$$AGE^AUPNPAT(DFN,DT)
  1. Q
  1. C ;
  1. S X=$P($G(^AUPNPAT(DFN,11)),U,18)
  1. I X="" S X="<NONE>"
  1. Q
  1. G ;
  1. S X=$$GET1^DIQ(2,DFN,.02)
  1. I X="" S X="UNKNOWN"
  1. Q
  1. M ;
  1. S X=$$GET1^DIQ(9002241,BDMX,6)
  1. I X="" S X="<NONE>"
  1. Q
  1. W ;
  1. S X=$$GET1^DIQ(9002241,BDMX,10)
  1. I X="" S X="<NONE>"
  1. Q
  1. TEST ;
  1. D BDMG("R",1,"A")
  1. Q
  1. BDMG(BDMIEN,BDMREG,BDMAGET,BDMSTAT,BDMCOMT,BDMCOMM,BDMSEX,BDMCM,BDMWF,BDMSORT1,BDMSORT2,BDMTEMP,BDMDEMO,BDMSTMP) ;EP - GUI DMS Entry Point
  1. S BDMND=$G(BDMND)
  1. S BDMGUI=1
  1. S BDMLDAT=$G(BDMLDAT)
  1. I BDMAGET="" K BDMAGET
  1. I BDMSTMP]"" S BDMSNAM=$P(^DIBT(BDMSTMP,0),U)
  1. S BDMSOR1T=$S(BDMSORT1="P":"Patient Name",BDMSORT1="S":"Register Status",BDMSORT1="A":"Age",BDMSORT1="C":"Community",BDMSORT1="G":"Gender",BDMSORT1="M":"Case Manager",BDMSORT1="W":"Where Followed",1:"")
  1. S BDMSOR2T=$S(BDMSORT2="P":"Patient Name",BDMSORT2="S":"Register Status",BDMSORT2="A":"Age",BDMSORT2="C":"Community",BDMSORT2="G":"Gender",BDMSORT2="M":"Case Manager",BDMSORT2="W":"Where Followed",1:"Patient Name")
  1. I BDMSORT2="" S BDMSORT2="P"
  1. NEW BDMNOW,BDMOPT,BDMIEN
  1. S BDMOPT="Master List"
  1. D NOW^%DTC
  1. S BDMNOW=$G(%)
  1. K DD,DO,DIC
  1. S X=DUZ_BDMNOW
  1. S DIC("DR")=".02////"_DUZ_";.03////"_BDMNOW_";.06///"_$G(BDMOPT)_";.07////R"
  1. S DIC="^BDMGUI(",DIC(0)="L",DIADD=1,DLAYGO=9003201.4
  1. D FILE^DICN
  1. K DIADD,DLAYGO,DIC,DA
  1. I Y=-1 S BDMIEN=-1 Q
  1. S BDMIEN=+Y
  1. S BDMGIEN=BDMIEN ;cmi/maw added
  1. D ^XBFMK
  1. K ZTSAVE S ZTSAVE("*")=""
  1. ;D GUIEP ;for interactive testing
  1. S ZTIO="",ZTDTH=$$NOW^XLFDT,ZTRTN="GUIEP^BDMRML",ZTDESC="GUI MASTER LIST" D ^%ZTLOAD
  1. D EXIT
  1. Q
  1. GUIEP ;EP
  1. D PROC
  1. K ^TMP($J,"BDMRML")
  1. S IOM=80
  1. D GUIR^XBLM("PRINT^BDMRML","^TMP($J,""BDMRML"",")
  1. S X=0,C=0 F S X=$O(^TMP($J,"BDMRML",X)) Q:X'=+X D
  1. .S BDMDATA=^TMP($J,"BDMRML",X)
  1. .;I BDMDATA="ZZZZZZZ" ;S BDMDATA=$C(12)
  1. .S ^BDMGUI(BDMIEN,11,X,0)=BDMDATA,C=C+1
  1. S ^BDMGUI(BDMIEN,11,0)="^^"_C_"^"_C_"^"_DT_"^"
  1. S DA=BDMIEN,DIK="^BDMGUI(" D IX1^DIK
  1. D ENDLOG
  1. K ^TMP($J,"BDMRML")
  1. D EXIT
  1. S ZTREQ="@"
  1. Q
  1. ;
  1. ENDLOG ;-- write the end of the log
  1. D NOW^%DTC
  1. S BDMNOW=$G(%)
  1. S DIE="^BDMGUI(",DA=BDMIEN,DR=".04////"_BDMNOW_";.07////C"
  1. D ^DIE
  1. K DIE,DR,DA
  1. Q
  1. EN2 ;EP
  1. S BDMSTMP="",BDMSNAM=""
  1. S DIC="^DIBT(",DIC(0)="AELMQZ",DIC("A")="Search Template: ",DIC("S")="I $P(^(0),U,4)=9000001&($P(^(0),U,5)=DUZ)"
  1. W !
  1. D ^DIC
  1. I +Y<1 W !!,"No Search Template selected." H 2 Q
  1. S BDMDIC=DIC ;ihs/cmi/maw 03/11/2014 patch 8
  1. S BDMSTMP=+Y,BDMSNAM=$P(^DIBT(BDMSTMP,0),U)
  1. DUP I '$P(Y,U,3) D I Q K BDMSTMP,Y G EN2
  1. .S Q=""
  1. .W !!,$C(7),$C(7)
  1. .S DIR(0)="Y",DIR("A")="That template already exists!! Do you want to overwrite it",DIR("B")="N" K DA D ^DIR K DIR
  1. .I $D(DIRUT) S Q=1 Q
  1. .I 'Y S Q=1 Q
  1. .L +^DIBT(BDMSTMP):10
  1. .S BDMSTN=$P(^DIBT(BDMSTMP,0),U) S DA=BDMSTMP,DIK="^DIBT(" D ^DIK
  1. .S ^DIBT(BDMSTMP,0)=BDMSNAM,DA=BDMSTMP,DIK="^DIBT(" D IX1^DIK
  1. .L -^DIBT(BDMSTMP)
  1. .Q
  1. I BDMSTMP,$D(^DIBT(BDMSTMP)) D
  1. .W !!,?5,"An unduplicated patient list resulting from this report",!,?5,"will be stored in the.........>",!!?18,"** ",BDMSNAM," ** Search Template."
  1. .K ^DIBT(BDMSTMP,1)
  1. .S DHIT="S ^DIBT("_BDMSTMP_",1,$P("_BDMDIC_"D0,0),U,2))="""""
  1. .S DIE="^DIBT(",DA=BDMSTMP,DR="2////"_DT_";3////M;4////9000001;5////"_DUZ_";6////M"
  1. .D ^DIE
  1. .K DIE,DA,DR
  1. Q
  1. ;Run Template in Background Mode
  1. ;
  1. BACK ;
  1. S DHD="W ?0 D HDR^BDMSTMP",FLDS="!.01"
  1. W !!,"A brief report will be printed after the search template is complete.",!,"You must enter a device for this report OR you may queue at this time.",!
  1. Q
  1. HDR ;
  1. W !!,?15,"***SEARCH TEMPLATE CREATION***"
  1. W !!,?1,"Template Created: ",$P(^DIBT(BDMSTMP,0),U)
  1. W !,?1,"Created by: ",$P(^VA(200,DUZ,0),U)
  1. W !,"------------------------------------------------------------------------------",!
  1. Q