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

ORWDBA12.m

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