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

ORWDBA83.m

Go to the documentation of this file.
  1. ORWDBA83 ; SLC/GDU - Billing Awareness - Phase I [10/18/04 10:52]
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**195**;Dec 17, 1997
  1. ;
  1. ;Enable Clinical Indicator Data Capture By Provider Parameter Module
  1. ;ORWDBA83 - Assign the parameter to a selected provider and manually set
  1. ; the CIDC by provider parameter to enable/disable the CIDC
  1. ; functionality
  1. ;
  1. ;Local Variables
  1. ;CNT Counter - Used to get count of providers who do not have
  1. ; the parameter assigned to them.
  1. ;DIR Input array variable for ^DIR
  1. ;DTOUT Timeout indicator, output variable of ^DIR
  1. ;DUOUT Up arrow indicator, output variable of ^DIR
  1. ;OREM Error Message, output from FIND^DIC
  1. ;ENT Entity the parameter is assigned to, input variable for
  1. ; ADD^XPAR
  1. ;FILE File Number of file searched, input variable for FIND^DIC
  1. ;FLD Field Number of fields to be returned in oputput, input
  1. ; variable for FIND^DIC
  1. ;FLG Flags for search method and output format, input variable
  1. ; for FIND^DIC
  1. ;FST First, a control variable to help build DIR(0) in MT10P
  1. ;HC Help Count, a control variable to help build DIR("?"
  1. ; in MT10P.
  1. ;ID Indentifier, input variable for FIND^DIC
  1. ;IEN Internal Entry Number, standard FileMan variable for a
  1. ; record's internal id number. Input variable for
  1. ; FIND^DIC. Used to build ENT.
  1. ;IND Index, input variable for FIND^DIC
  1. ;INST Instance indicator, input variable for ENVAL^XPAR
  1. ;IOF Clear Screen and move cursor to top of screen, standard
  1. ; Kernal IO variable
  1. ;NAME Provider Name, parsed from RF output array from FIND^DIC
  1. ;NUM Maximum number of records to return, input variable for
  1. ; FIND^DIC
  1. ;NX0 Next group of providers prompt, used to help build DIR(0)
  1. ;NXC Next group of providers count, used to help build DIR(0)
  1. ;NXH Next group of providers help, used to help build DIR("?"
  1. ;PAR The Name or IEN of a parameter in the PARAMETER DEFINITION
  1. ; FILE, input variable for ADD^XPAR
  1. ;RF Records Found, the array variable with the results found
  1. ; by FIND^DIC
  1. ;RFC Records Found Count, The first piece of the zero node in
  1. ; the output array from FIND^DIC with the total number
  1. ; records returned
  1. ;ORSCR Screen, an input variable for FIND^DIC to filter out
  1. ; records from the search.
  1. ;SP Selected Provider, set to the value of Y when the user
  1. ; selects a provider from the list of providers returned
  1. ; by FIND^DIC
  1. ;U FileMan standard variable for data delimiter, equals "^"
  1. ;VAL Value of the parameter being added, input variable for
  1. ; ADD^XPAR
  1. ;X Standard FileMan work varaible
  1. ;X1
  1. ;Y Processed output of user selection, output variable for
  1. ; ^DIR
  1. ;
  1. ;Global Variables
  1. ;^XTV(8989.51 PARAMETER DEFINITION FILE, file # 8989.51
  1. ;
  1. ;External References
  1. ;FIND^DIC FileMan silent database call, returns an array of records
  1. ; matching or partly matching a value searched on.
  1. ;^DIR FileMan general purpose response reader
  1. ;KTG^ORWDBA8 Kills the temp globals
  1. ;LISTA^ORWDBA8
  1. ; Builds temp global ^TMP("ORPAL", a list of providers who
  1. ; have the Enable CIDC parameter assigned to them.
  1. ;LISTU^ORWDBA8
  1. ; Builds temp global ^TMP("ORPUL", a list of providers who
  1. ; do not have the Enable CIDC parameter assigned to them.
  1. ;ADD^XPAR PARAMETER TOOLS, API to add a new parameter value
  1. ;
  1. START ;Starting point of this program
  1. N CNT,DIR,DTOUT,DUOUT,OREM,ENT,FILE,FLD,FLG,FST,HC,ID,IEN,IND,INST,NAME
  1. N NUM,NX0,NXC,NXH,PAR,RF,RFC,ORSCR,SP,VAL,X,X1,Y
  1. ;Ask user for provider
  1. S DIR(0)=$P($T(FT0),";",3)
  1. S DIR("A")=$P($T(FA),";",3)
  1. S DIR("?",1)=$P($T(FH1),";",3)
  1. S DIR("?",2)=$P($T(FH2),";",3)
  1. S DIR("?",3)=$P($T(FH3),";",3)
  1. S DIR("?")=$P($T(FH4),";",3)
  1. D SCRHDR,^DIR
  1. ;Process user entry, search for provider
  1. I Y=""!($D(DTOUT))!($D(DUOUT)) G EXIT
  1. S FILE=200,FLD="@;.01",FLG="CP",(ID,IEN,IND,SP)="",NUM="*",VAL=Y
  1. S ORSCR="I $D(^XUSEC(""PROVIDER"",Y)"
  1. S ORSCR("S")="I $D(^TMP(""ORPUL"",$J,""A"",Y))=1"
  1. D FIND^DIC(FILE,IEN,FLD,FLG,VAL,NUM,IND,.ORSCR,ID,"RF","OREM")
  1. S RFC=$P(RF("DILIST",0),U)
  1. ;No matchs found alert user
  1. I RFC=0 D ALERT G START
  1. ;Single match found skip to parameter assign
  1. I RFC=1 S SP=RFC D ASSIGN G START
  1. ;10 or less matchs found, present for user selection
  1. I RFC<10!(RFC=10) D LTE10P
  1. ;More than 10 matchs found, present for user selection
  1. I RFC>10 S FST=1 D MT10P
  1. ;Process user selection from LTE10P or MT10P
  1. I SP="Q" G EXIT
  1. I SP="" D KILLVAR G START
  1. D ASSIGN G START
  1. EXIT ;Exit point for this program
  1. Q
  1. ALERT ;Alert the user that the selection returned no records.
  1. K DIR,X1
  1. S DIR(0)="E",X1=""
  1. S DIR("A",1)=$P($T(UA1),";",3)_" "_VAL_"."
  1. F X=2:1:5 S X1="UA"_X,DIR("A",X)=$P($T(@X1),";",3)
  1. S DIR("A")=$P($T(UA6),";",3)
  1. D SCRHDR,^DIR
  1. D KILLVAR
  1. Q
  1. ASSIGN ;Assign the parameter and enable/disable CIDC functionality
  1. S IEN=$P(RF("DILIST",SP,0),U),NAME=$P(RF("DILIST",SP,0),U,2)
  1. S DIR(0)=$P($T(SCO),";",3)_$P($T(PE),";",3)_";"_$P($T(PD),";",3)
  1. S DIR("A")=$P($T(PA),";",3)
  1. S DIR("?",1)=$P($T(PHE),";",3),DIR("?")=$P($T(PHE),";",3)
  1. D SCRHDR
  1. W !!,$P($T(M1),";",3)," ",NAME," ",$P($T(M2),";",3),!,$P($T(M3),";",3)
  1. D ^DIR
  1. I Y=""!($D(DTOUT))!($D(DUOUT)) Q
  1. S VAL=$S(Y="E":1,1:0),ENT=IEN_";VA(200,",INST=1,OREM=""
  1. S PAR=$QS($Q(^XTV(8989.51,"B","OR BILLING AWARENESS BY USER")),4)
  1. D ADD^XPAR(ENT,PAR,INST,VAL,.OREM)
  1. D KILLVAR,KTG,LISTA,LISTU
  1. Q
  1. LTE10P ;If search returned a list less then or equal to 10
  1. D SETDIR
  1. F X=1:1:RFC S DIR(0)=DIR(0)_X_":"_$P(RF("DILIST",X,0),U,2)_";"
  1. D SCRHDR,^DIR
  1. I $D(DTOUT)!($D(DUOUT)) S SP="Q"
  1. E S SP=Y
  1. Q
  1. MT10P ;If search returned more then 10 providers
  1. D SETDIR
  1. S CNT=0,HC=1,(NXC,NX0,NXH,SP,X,Y)=""
  1. F X=FST:1:10+(FST-1) Q:$D(RF("DILIST",X,0))=0 D
  1. . S CNT=CNT+1
  1. . S DIR(0)=DIR(0)_X_":"_$P(RF("DILIST",X,0),U,2)_";"
  1. S NXC=RFC-X,NXC=$S(NXC>10:10,1:NXC)
  1. S NX0=$P($P($T(D0N),";",3),"|",1)_NXC_$P($P($T(D0N),";",3),"|",2)
  1. S NXH=$P($P($T(DHN),";",3),"|",1)_NXC_$P($P($T(DHN),";",3),"|",2)
  1. S:CNT=10 DIR(0)=DIR(0)_";"_NX0
  1. S:FST>10 DIR(0)=DIR(0)_";"_$P($T(D0P),";",3)
  1. S:CNT=10 HC=HC+1,DIR("?",HC)=NXH
  1. S:FST>10 HC=HC+1,DIR("?",HC)=$P($T(DHP),";",3)
  1. D SCRHDR,^DIR
  1. I $D(DTOUT)!($D(DUOUT)) S SP="Q" Q
  1. I Y="N"!(Y="P") S FST=$S(Y="N":FST+10,1:FST-10) G MT10P
  1. S SP=Y Q
  1. ;
  1. SETDIR ;Set common values for DIR used by LTE10P and MT10P
  1. K DIR
  1. S DIR(0)=$P($T(SCO),";",3)
  1. S DIR("?",1)=$P($T(DH),";",3)
  1. S DIR("?")=$P($T(DHS),";",3)
  1. S DIR("A")=$P($T(DA),";",3)
  1. Q
  1. SCRHDR ;Screen Header
  1. W:$D(IOF) @IOF
  1. W !,$P($T(SH1),";",3),!,$P($T(SH2),";",3),!
  1. Q
  1. KILLVAR ;Kill variables to prepare for next look up
  1. K DIR,DTOUT,DUOUT,OREM,ENT,FILE,FLD,FLG,ID,IEN,IND,INST,NAME,NUM,NXC,NX0
  1. K NXH,RF,RFC,ORSCR,SP,VAL,X,X1,Y
  1. Q
  1. KTG ;Kill the temp globals used by this program
  1. K ^TMP("ORPAL",$J),^TMP("ORPUL",$J) Q
  1. LISTA ;Build a list of providers with the parameter already assigned to them.
  1. N ORERR,GBL,IEN,INST,LIST,PAR,X
  1. S LIST="^TMP(""ORPAL"",$J,""A"")",(INST,GBL)=1,ORERR=""
  1. S PAR=$QS($Q(^XTV(8989.51,"B","OR BILLING AWARENESS BY USER")),4)
  1. D ENVAL^XPAR(LIST,PAR,INST,.ORERR,GBL)
  1. S (IEN,X)="" F S X=$O(^TMP("ORPAL",$J,"A",X)) Q:X="" D
  1. . S IEN=$P(X,";"),^TMP("ORPAL",$J,"B",IEN)=""
  1. Q
  1. LISTU ;Build a list of providers who have not been assigned the parameter
  1. N CNT,IEN
  1. S IEN="",CNT=0,^TMP("ORPUL",$J,"A")=CNT
  1. F S IEN=$O(^XUSEC("PROVIDER",IEN)) Q:IEN="" D
  1. . I $D(^TMP("ORPAL",$J,"A",IEN_";VA(200,",1))=1 Q
  1. . S CNT=CNT+1,^TMP("ORPUL",$J,"A")=CNT
  1. . S ^TMP("ORPUL",$J,"A",IEN)=IEN_";VA(200,"
  1. Q
  1. ;;Text used to build options, user messages, and help
  1. FT0 ;;FO^1:40
  1. FA ;;Select the provider to assign the parameter
  1. FH1 ;;Enter the name/partial name of the provider to assign the parameter.
  1. FH2 ;;This is free text, 1 to 40 characters in length.
  1. FH3 ;;This search will only return those with the PROVIDER key and who
  1. FH4 ;;do not have the CIDC parameter assigned to them.
  1. SCO ;;SO^
  1. SH1 ;;Enable Clinical Indicator Data Capture By Provider Parameter Management
  1. SH2 ;;Assign and Enable/Disable Parameter By Individual Provider Option
  1. UA1 ;;Found no records matching the search criteria of
  1. UA2 ;;The reasons for this could be that during the search:
  1. UA3 ;; 1. The parameter is already assigned to any provider found.
  1. UA4 ;; 2. No providers found.
  1. UA5 ;; 3. No records found.
  1. UA6 ;;Please try again
  1. M1 ;;You have selected
  1. M2 ;;to assign the Enable Clinical Indicator Data
  1. M3 ;;Capture By Provider parameter to.
  1. PE ;;E:Assign parameter and Enable CIDC for this provider
  1. PD ;;D:Assign parameter and Disable CIDC for this provider
  1. PA ;;Assign the parameter to this provider
  1. PHE ;;Enter E to assign the parameter and enable CIDC for this provider.
  1. PHD ;;Enter D to assign the parameter and disable CIDC for this provider.
  1. D0N ;;N:Next | providers
  1. D0P ;;P:Previous 10 providers
  1. DH ;;Select the provider who the parameter will be assigned to.
  1. DHN ;;Enter N to get the next | providers.
  1. DHP ;;Enter P to get the previous 10 providers.
  1. DHS ;;Enter "^" to exit or the Enter key to return to provider lookup.
  1. DA ;;Select the provider to assign the parameter