ORWDBA12 ; SLC/GDU - Billing Awareness - Phase I [10/18/04 10:24]
;;3.0;ORDER ENTRY/RESULTS REPORTING;**195**;Dec 17, 1997
;
;Enable Clinical Indicator Data Capture By Provider Parameter Module
;ORWDBA12 - Delete the assigned parameter
;
;This program is used to delete the assigned parameter of a selected
;provider.
;
;Programs Called:
; GETS^DIQ Silent FileMan DBS call to get provider information
; ^DIR General purpose response reader
; DEL^XPAR Deletes the selected parameter
; ENVAL^XPAR Returns list of records related to the parameter
;
;Variables used:
; BAEI Billing Awareness Enabled Parameter Internal value
; DIR Input array variable for ^DIR
; DTOUT Timeout indicator output variable for ^DIR
; DUOUT Up Arrow '^' indictor output variable for ^DIR
; ENT Enitity, input variable for ^XPAR
; ORERR Error, output variable for ^XPAR, and ^DIQ
; FILE File number, input variable for ^DIQ
; FLD Field number, input variable for ^DIQ
; FLG Flag, input parameters variable for ^DIQ
; FST Work variable controls build of user selection display
; GBL Global, input parameter to direct ^XPAR output to a global
; HC Help Count, work variable to set help text lines for ^DIR
; INST Instance, input variable for ^XPAR
; LIST List, output variable for ^XPAR
; OPTCNT Option Count, counter variable to build options display
; input variable for ^DIR
; PAR Parameter, IEN of the parameter being worked with, input
; variable for ^XPAR
; PRVCNT Provider Count, counter variable to determine the number
; of providers with the parameter assigned to them
; PRVIEN Provider IEN, the internal entry number of the provider
; PRVNAME Provider Name, the name of the provider
; RF Record Found, output variable for ^DIQ
; SELKEY Selected Key, work variable the IEN of the temp global
; indicating the user's selection.
; U Delemiter variable, defaulted to ^
; X Standard work variable
; Y Processed user selection output variable for ^DIC
;
;Globals Used:
;^XTV(8989.51,"B"
; Standard B index for the Parameters file.
; ^XTV(8989.51,"B",Parameter Name,Parameter IEN)
;^TMP("ORPAL",$J
; Multipurpose temp global used for the delete process
; Output global for ^XPAR
; ^TMP("ORPAL",$J,"A")=total records returned
; ^TMP("ORPAL",$J,"A",Provider IEN_";VA(200,",1)=parameter value
; First pass processing of ^XPAR output
; ^TMP("ORPAL",$J,"B",Provider Name)=IEN^param value
; Second pass processing of ^XPAR output, work data for program
; ^TMP("ORPAL",$J,"C",Record Count)=Name^IEN^param value
; Third pass processing of ^XPAR output, input data for ^DIR, used
; to create the user selection interface
; ^TMP("ORPAL",$J,"D",Provider Name)=Record Count from "C"
MAIN ;Main starting point for the delete assigned Enable BA By User
;process
N BAEI,DIR,DTOUT,DUOUT,ENT,ORERR,FILE,FLD,FLG,FST,GBL,HC,INST,LIST
N OPTCNT,PAR,PRVCNT,PRVIEN,PRVNAME,RF,SELKEY,U,X,Y
K ^TMP("ORPAL",$J),^TMP("SPL",$J)
S U="^",(INST,GBL)=1
S PAR=$QS($Q(^XTV(8989.51,"B","OR BILLING AWARENESS BY USER")),4)
BLDLST ;Build list of providers with the Enable CIDC By User parameter already
;assigned to them.
S LIST="^TMP(""ORPAL"",$J,""A"")"
D ENVAL^XPAR(LIST,PAR,INST,.ORERR,GBL)
I ^TMP("ORPAL",$J,"A")=0 D G EXIT
. D SCRHDR
. S DIR(0)="E"
. S DIR("A",1)=$P($T(NPA1),";",2)
. S DIR("A",2)=$P($T(NPA2),";",2)
. S DIR("A",3)=$P($T(NPA3),";",2)
. S DIR("A")=$P($T(NPA4),";",2)
. W !!! D ^DIR K DIR
S FILE=200,FLD=.01,(BAEI,FLG,PRVIEN,PRVNAME,X)=""
F S X=$O(^TMP("ORPAL",$J,"A",X)) Q:X="" D
. S PRVIEN=$P(X,";")
. S BAEI=^TMP("ORPAL",$J,"A",X,1)
. K RF,ERR
. D GETS^DIQ(FILE,PRVIEN,FLD,FLG,"RF","ERR")
. S PRVNAME=RF(FILE,PRVIEN_",",.01)
. S ^TMP("ORPAL",$J,"B",PRVNAME)=PRVIEN_U_BAEI
S PRVNAME="",PRVCNT=0
F S PRVNAME=$O(^TMP("ORPAL",$J,"B",PRVNAME)) Q:PRVNAME="" D
. S PRVCNT=PRVCNT+1
. S ^TMP("ORPAL",$J,"C",PRVCNT)=PRVNAME_U_^TMP("ORPAL",$J,"B",PRVNAME)
S PRVNAME="",PRVCNT=0
F S PRVCNT=$O(^TMP("ORPAL",$J,"C",PRVCNT)) Q:PRVCNT="" D
. S PRVNAME=$P(^TMP("ORPAL",$J,"C",PRVCNT),U)
. S ^TMP("ORPAL",$J,"D",PRVNAME)=PRVCNT
S FST=1 ;Prepare for display
DISOPT ;Display the list of providers with the Enable BDC By User parameter
;assigned to them. The user selects from this list the provider
;whose parameter is to be deleted.
DO1 S FST=1 ;Prepare for display
DO2 D SCRHDR ;Display starts here
S (OPTCNT,PRVNAME,X)="",DIR(0)="SO"_U
F X=FST:1:10+(FST-1) Q:$D(^TMP("ORPAL",$J,"C",X))=0 D
. S OPTCNT=OPTCNT+1
. S:OPTCNT>10 OPTCNT=1
. S PRVNAME=$P(^TMP("ORPAL",$J,"C",X),U)
. S DIR(0)=DIR(0)_OPTCNT_":"_PRVNAME_";"
S:OPTCNT=10 DIR(0)=DIR(0)_";"_$P($T(D0N),";",2)
S:FST>10 DIR(0)=DIR(0)_";"_$P($T(D0P),";",2)
S DIR(0)=DIR(0)_";"_$P($T(D0Q),";",2)
S HC=1,DIR("?",HC)=$P($T(DHD),";",2)
S:OPTCNT=10 HC=HC+1,DIR("?",HC)=$P($T(DHN),";",2)
S:FST>10 HC=HC+1,DIR("?",HC)=$P($T(DHP),";",2)
S DIR("A")=$P($T(DAD),";",2)
S DIR("?")=$P($T(DHQ),";",2)
D ^DIR K DIR
I Y="Q"!(Y="")!($D(DTOUT))!($D(DUOUT)) G EXIT
I Y="N" S FST=FST+10 G DO2
I Y="P" S FST=FST-10 G DO2
S PRVNAME=Y(0),(SELKEY,PRVIEN)=""
S SELKEY=^TMP("ORPAL",$J,"D",PRVNAME)
S PRVIEN=$P(^TMP("ORPAL",$J,"C",SELKEY),U,2)
S BAEI=$P(^TMP("ORPAL",$J,"C",SELKEY),U,3)
DELETE ;Confirm the selected provider and delete the selected provider's
;assigned Enable BDC By User parameter
D SCRHDR
W !!,$P($P($T(DPM),";",2),"|"),PRVNAME,$P($P($T(DPM),";",2),"|",2)
I BAEI=1 W !,$P($T(DPEM),";",2)
E W !,$P($T(DPDM),";",2)
S DIR(0)="Y"
S DIR("A")=$P($T(DPA),";",2)
S DIR("B")="N"
S DIR("?",1)=$P($T(DPHY),";",2)
S DIR("?")=$P($T(DPHN),";",2)
D ^DIR K DIR
I $D(DTOUT)!($D(DUOUT)) Q
I Y=1 D
. S ENT=PRVIEN_";VA(200,"
. D DEL^XPAR(ENT,PAR,INST,.ORERR)
AGAIN ;Ask the user if they want to do the delete process again.
S DIR(0)="Y"
S DIR("A")=$P($T(ADA),";",2)
S DIR("B")="N"
S DIR("?",1)=$P($T(ADHY),";",2)
S DIR("?")=$P($T(ADHN),";",2)
W !! D ^DIR K DIR
I Y=1 G MAIN
G EXIT
NPA ;No Parameter Set
;Error trap for no Enable BDC By User parameter are currently assigned
D SCRHDR
S DIR(0)="E"
S DIR("A",1)=$P($T(NPA1),";",2)
S DIR("A",2)=$P($T(NPA2),";",2)
S DIR("A",3)=$P($T(NPA3),";",2)
S DIR("A")=$P($T(NPA4),";",2)
EXIT ;Common exit point for this program
K ^TMP("ORPAL",$J)
Q
SCRHDR ;Screen Header Display
W:$D(IOF) @IOF
W !,"Enable Clinical Indicator Data Capture By Provider Parameter Management"
W !,"Delete Assigned Parameter"
Q
;Text for the user prompt in NPA
NPA1 ;No providers currently have the parameter assigned to them.
NPA2 ;You will need to select the 'Assign parameter to provider' option and
NPA3 ;assign this parameter to the providers.
NPA4 ;Press the return key or '^' to continue
;This is the text to build the DIR variables for use with ^DIR in
;DISOPT
D0N ;N:Next 10 Providers
D0P ;P:Previous 10 Providers
D0Q ;Q:Quit
DAD ;Select the provider to delete the assigned parameter
DHD ;Select the provider whose assigned parameter value is to be deleted.
DHN ;Enter N for the next 10 providers in the list.
DHP ;Enter P for the previous 10 providers in the list.
DHQ ;Enter Q to quit and return to the previous menu
;This is the text to build the DIR variable for use with ^DIR in DELETE
;and the user message.
DPM ;You have selected | to delete.
DPEM ;Clinical Indicator Data Capture for this provider is currently enabled.
DPDM ;Clinical Indicator Data Capture for this provider is currently disabled.
DPA ;Are you sure that you want to delete this provider's parameter
DPHY ;Enter Y for Yes to confirm deletion of this provider's parameter.
DPHN ;Enter N for No to not delete this provider's parameter.
;This is the text to build the DIR variable for use with ^DIR in AGAIN
ADA ;Delete another provider's parameter
ADHY ;Enter Y for Yes to delete another provider's parameter.
ADHN ;Enter N for No to not delete another provider's parameter.
ORWDBA12 ; SLC/GDU - Billing Awareness - Phase I [10/18/04 10:24]
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**195**;Dec 17, 1997
+2 ;
+3 ;Enable Clinical Indicator Data Capture By Provider Parameter Module
+4 ;ORWDBA12 - Delete the assigned parameter
+5 ;
+6 ;This program is used to delete the assigned parameter of a selected
+7 ;provider.
+8 ;
+9 ;Programs Called:
+10 ; GETS^DIQ Silent FileMan DBS call to get provider information
+11 ; ^DIR General purpose response reader
+12 ; DEL^XPAR Deletes the selected parameter
+13 ; ENVAL^XPAR Returns list of records related to the parameter
+14 ;
+15 ;Variables used:
+16 ; BAEI Billing Awareness Enabled Parameter Internal value
+17 ; DIR Input array variable for ^DIR
+18 ; DTOUT Timeout indicator output variable for ^DIR
+19 ; DUOUT Up Arrow '^' indictor output variable for ^DIR
+20 ; ENT Enitity, input variable for ^XPAR
+21 ; ORERR Error, output variable for ^XPAR, and ^DIQ
+22 ; FILE File number, input variable for ^DIQ
+23 ; FLD Field number, input variable for ^DIQ
+24 ; FLG Flag, input parameters variable for ^DIQ
+25 ; FST Work variable controls build of user selection display
+26 ; GBL Global, input parameter to direct ^XPAR output to a global
+27 ; HC Help Count, work variable to set help text lines for ^DIR
+28 ; INST Instance, input variable for ^XPAR
+29 ; LIST List, output variable for ^XPAR
+30 ; OPTCNT Option Count, counter variable to build options display
+31 ; input variable for ^DIR
+32 ; PAR Parameter, IEN of the parameter being worked with, input
+33 ; variable for ^XPAR
+34 ; PRVCNT Provider Count, counter variable to determine the number
+35 ; of providers with the parameter assigned to them
+36 ; PRVIEN Provider IEN, the internal entry number of the provider
+37 ; PRVNAME Provider Name, the name of the provider
+38 ; RF Record Found, output variable for ^DIQ
+39 ; SELKEY Selected Key, work variable the IEN of the temp global
+40 ; indicating the user's selection.
+41 ; U Delemiter variable, defaulted to ^
+42 ; X Standard work variable
+43 ; Y Processed user selection output variable for ^DIC
+44 ;
+45 ;Globals Used:
+46 ;^XTV(8989.51,"B"
+47 ; Standard B index for the Parameters file.
+48 ; ^XTV(8989.51,"B",Parameter Name,Parameter IEN)
+49 ;^TMP("ORPAL",$J
+50 ; Multipurpose temp global used for the delete process
+51 ; Output global for ^XPAR
+52 ; ^TMP("ORPAL",$J,"A")=total records returned
+53 ; ^TMP("ORPAL",$J,"A",Provider IEN_";VA(200,",1)=parameter value
+54 ; First pass processing of ^XPAR output
+55 ; ^TMP("ORPAL",$J,"B",Provider Name)=IEN^param value
+56 ; Second pass processing of ^XPAR output, work data for program
+57 ; ^TMP("ORPAL",$J,"C",Record Count)=Name^IEN^param value
+58 ; Third pass processing of ^XPAR output, input data for ^DIR, used
+59 ; to create the user selection interface
+60 ; ^TMP("ORPAL",$J,"D",Provider Name)=Record Count from "C"
MAIN ;Main starting point for the delete assigned Enable BA By User
+1 ;process
+2 NEW BAEI,DIR,DTOUT,DUOUT,ENT,ORERR,FILE,FLD,FLG,FST,GBL,HC,INST,LIST
+3 NEW OPTCNT,PAR,PRVCNT,PRVIEN,PRVNAME,RF,SELKEY,U,X,Y
+4 KILL ^TMP("ORPAL",$JOB),^TMP("SPL",$JOB)
+5 SET U="^"
SET (INST,GBL)=1
+6 SET PAR=$QSUBSCRIPT($QUERY(^XTV(8989.51,"B","OR BILLING AWARENESS BY USER")),4)
BLDLST ;Build list of providers with the Enable CIDC By User parameter already
+1 ;assigned to them.
+2 SET LIST="^TMP(""ORPAL"",$J,""A"")"
+3 DO ENVAL^XPAR(LIST,PAR,INST,.ORERR,GBL)
+4 IF ^TMP("ORPAL",$JOB,"A")=0
Begin DoDot:1
+5 DO SCRHDR
+6 SET DIR(0)="E"
+7 SET DIR("A",1)=$PIECE($TEXT(NPA1),";",2)
+8 SET DIR("A",2)=$PIECE($TEXT(NPA2),";",2)
+9 SET DIR("A",3)=$PIECE($TEXT(NPA3),";",2)
+10 SET DIR("A")=$PIECE($TEXT(NPA4),";",2)
+11 WRITE !!!
DO ^DIR
KILL DIR
End DoDot:1
GOTO EXIT
+12 SET FILE=200
SET FLD=.01
SET (BAEI,FLG,PRVIEN,PRVNAME,X)=""
+13 FOR
SET X=$ORDER(^TMP("ORPAL",$JOB,"A",X))
IF X=""
QUIT
Begin DoDot:1
+14 SET PRVIEN=$PIECE(X,";")
+15 SET BAEI=^TMP("ORPAL",$JOB,"A",X,1)
+16 KILL RF,ERR
+17 DO GETS^DIQ(FILE,PRVIEN,FLD,FLG,"RF","ERR")
+18 SET PRVNAME=RF(FILE,PRVIEN_",",.01)
+19 SET ^TMP("ORPAL",$JOB,"B",PRVNAME)=PRVIEN_U_BAEI
End DoDot:1
+20 SET PRVNAME=""
SET PRVCNT=0
+21 FOR
SET PRVNAME=$ORDER(^TMP("ORPAL",$JOB,"B",PRVNAME))
IF PRVNAME=""
QUIT
Begin DoDot:1
+22 SET PRVCNT=PRVCNT+1
+23 SET ^TMP("ORPAL",$JOB,"C",PRVCNT)=PRVNAME_U_^TMP("ORPAL",$JOB,"B",PRVNAME)
End DoDot:1
+24 SET PRVNAME=""
SET PRVCNT=0
+25 FOR
SET PRVCNT=$ORDER(^TMP("ORPAL",$JOB,"C",PRVCNT))
IF PRVCNT=""
QUIT
Begin DoDot:1
+26 SET PRVNAME=$PIECE(^TMP("ORPAL",$JOB,"C",PRVCNT),U)
+27 SET ^TMP("ORPAL",$JOB,"D",PRVNAME)=PRVCNT
End DoDot:1
+28 ;Prepare for display
SET FST=1
DISOPT ;Display the list of providers with the Enable BDC By User parameter
+1 ;assigned to them. The user selects from this list the provider
+2 ;whose parameter is to be deleted.
DO1 ;Prepare for display
SET FST=1
DO2 ;Display starts here
DO SCRHDR
+1 SET (OPTCNT,PRVNAME,X)=""
SET DIR(0)="SO"_U
+2 FOR X=FST:1:10+(FST-1)
IF $DATA(^TMP("ORPAL",$JOB,"C",X))=0
QUIT
Begin DoDot:1
+3 SET OPTCNT=OPTCNT+1
+4 IF OPTCNT>10
SET OPTCNT=1
+5 SET PRVNAME=$PIECE(^TMP("ORPAL",$JOB,"C",X),U)
+6 SET DIR(0)=DIR(0)_OPTCNT_":"_PRVNAME_";"
End DoDot:1
+7 IF OPTCNT=10
SET DIR(0)=DIR(0)_";"_$PIECE($TEXT(D0N),";",2)
+8 IF FST>10
SET DIR(0)=DIR(0)_";"_$PIECE($TEXT(D0P),";",2)
+9 SET DIR(0)=DIR(0)_";"_$PIECE($TEXT(D0Q),";",2)
+10 SET HC=1
SET DIR("?",HC)=$PIECE($TEXT(DHD),";",2)
+11 IF OPTCNT=10
SET HC=HC+1
SET DIR("?",HC)=$PIECE($TEXT(DHN),";",2)
+12 IF FST>10
SET HC=HC+1
SET DIR("?",HC)=$PIECE($TEXT(DHP),";",2)
+13 SET DIR("A")=$PIECE($TEXT(DAD),";",2)
+14 SET DIR("?")=$PIECE($TEXT(DHQ),";",2)
+15 DO ^DIR
KILL DIR
+16 IF Y="Q"!(Y="")!($DATA(DTOUT))!($DATA(DUOUT))
GOTO EXIT
+17 IF Y="N"
SET FST=FST+10
GOTO DO2
+18 IF Y="P"
SET FST=FST-10
GOTO DO2
+19 SET PRVNAME=Y(0)
SET (SELKEY,PRVIEN)=""
+20 SET SELKEY=^TMP("ORPAL",$JOB,"D",PRVNAME)
+21 SET PRVIEN=$PIECE(^TMP("ORPAL",$JOB,"C",SELKEY),U,2)
+22 SET BAEI=$PIECE(^TMP("ORPAL",$JOB,"C",SELKEY),U,3)
DELETE ;Confirm the selected provider and delete the selected provider's
+1 ;assigned Enable BDC By User parameter
+2 DO SCRHDR
+3 WRITE !!,$PIECE($PIECE($TEXT(DPM),";",2),"|"),PRVNAME,$PIECE($PIECE($TEXT(DPM),";",2),"|",2)
+4 IF BAEI=1
WRITE !,$PIECE($TEXT(DPEM),";",2)
+5 IF '$TEST
WRITE !,$PIECE($TEXT(DPDM),";",2)
+6 SET DIR(0)="Y"
+7 SET DIR("A")=$PIECE($TEXT(DPA),";",2)
+8 SET DIR("B")="N"
+9 SET DIR("?",1)=$PIECE($TEXT(DPHY),";",2)
+10 SET DIR("?")=$PIECE($TEXT(DPHN),";",2)
+11 DO ^DIR
KILL DIR
+12 IF $DATA(DTOUT)!($DATA(DUOUT))
QUIT
+13 IF Y=1
Begin DoDot:1
+14 SET ENT=PRVIEN_";VA(200,"
+15 DO DEL^XPAR(ENT,PAR,INST,.ORERR)
End DoDot:1
AGAIN ;Ask the user if they want to do the delete process again.
+1 SET DIR(0)="Y"
+2 SET DIR("A")=$PIECE($TEXT(ADA),";",2)
+3 SET DIR("B")="N"
+4 SET DIR("?",1)=$PIECE($TEXT(ADHY),";",2)
+5 SET DIR("?")=$PIECE($TEXT(ADHN),";",2)
+6 WRITE !!
DO ^DIR
KILL DIR
+7 IF Y=1
GOTO MAIN
+8 GOTO EXIT
NPA ;No Parameter Set
+1 ;Error trap for no Enable BDC By User parameter are currently assigned
+2 DO SCRHDR
+3 SET DIR(0)="E"
+4 SET DIR("A",1)=$PIECE($TEXT(NPA1),";",2)
+5 SET DIR("A",2)=$PIECE($TEXT(NPA2),";",2)
+6 SET DIR("A",3)=$PIECE($TEXT(NPA3),";",2)
+7 SET DIR("A")=$PIECE($TEXT(NPA4),";",2)
EXIT ;Common exit point for this program
+1 KILL ^TMP("ORPAL",$JOB)
+2 QUIT
SCRHDR ;Screen Header Display
+1 IF $DATA(IOF)
WRITE @IOF
+2 WRITE !,"Enable Clinical Indicator Data Capture By Provider Parameter Management"
+3 WRITE !,"Delete Assigned Parameter"
+4 QUIT
+5 ;Text for the user prompt in NPA
NPA1 ;No providers currently have the parameter assigned to them.
NPA2 ;You will need to select the 'Assign parameter to provider' option and
NPA3 ;assign this parameter to the providers.
NPA4 ;Press the return key or '^' to continue
+1 ;This is the text to build the DIR variables for use with ^DIR in
+2 ;DISOPT
D0N ;N:Next 10 Providers
D0P ;P:Previous 10 Providers
D0Q ;Q:Quit
DAD ;Select the provider to delete the assigned parameter
DHD ;Select the provider whose assigned parameter value is to be deleted.
DHN ;Enter N for the next 10 providers in the list.
DHP ;Enter P for the previous 10 providers in the list.
DHQ ;Enter Q to quit and return to the previous menu
+1 ;This is the text to build the DIR variable for use with ^DIR in DELETE
+2 ;and the user message.
DPM ;You have selected | to delete.
DPEM ;Clinical Indicator Data Capture for this provider is currently enabled.
DPDM ;Clinical Indicator Data Capture for this provider is currently disabled.
DPA ;Are you sure that you want to delete this provider's parameter
DPHY ;Enter Y for Yes to confirm deletion of this provider's parameter.
DPHN ;Enter N for No to not delete this provider's parameter.
+1 ;This is the text to build the DIR variable for use with ^DIR in AGAIN
ADA ;Delete another provider's parameter
ADHY ;Enter Y for Yes to delete another provider's parameter.
ADHN ;Enter N for No to not delete another provider's parameter.