PXRRECSC ;ISL/PKR - PCE reports encounter selection criteria routines. ;7/7/97
;;1.0;PCE PATIENT CARE ENCOUNTER;**12,18,20**;Aug 12, 1996
;
;=======================================================================
ECAT ;Get a list of attributes for screening encounters.
N C2S,INDENT,VALID,X,Y
K DIRUT,DTOUT,DUOUT
S DIR(0)="YA"
S DIR("A",1)="This report will include all VA clinic encounters for all patients"
S DIR("A",2)="unless you modify the criteria. Do you want to modify the criteria?"
S DIR("A")="Enter Y (YES) or N (NO) "
S DIR("B")="N"
W !
D ^DIR K DIR
I $D(DIROUT) S DTOUT=1
I $D(DTOUT)!($D(DUOUT)) Q
I 'Y S PXRRECAT="" Q
;
S INDENT=2
S C2S=INDENT+5
K DIRUT,DUOUT
ECATP W !!,"Encounters may be selected by any combination of the following attributes:"
W !,?INDENT,"1",?C2S,"Service Category"
;W !,?INDENT,"2",?C2S,"Encounter Type"
W !,?INDENT,"2",?C2S,"Location"
W !,?INDENT,"3",?C2S,"Provider"
W !,?INDENT,"4",?C2S,"Age of Patient"
W !,?INDENT,"5",?C2S,"Race of Patient"
W !,?INDENT,"6",?C2S,"Sex of Patient"
S DIR(0)="LAO"_U_"1:6"
S DIR("A")="Enter encounter selection attribute number(s) "
S DIR("?",1)="This response may be a single number, a list, or a range, e.g. 2 or 1,3 or 2-5."
S DIR("?")="The valid numbers are 1 through 6."
S DIR("??")=U_"D ECATHELP^PXRRECSC"
D ^DIR K DIR
I $D(DIROUT) S DTOUT=1
I $D(DTOUT) Q
I $D(DUOUT) G ECAT
S PXRRECAT=Y
Q
;
ECATHELP ;
W !!,"Enter the number(s) corresponding to the desired selection attribute(s)."
W !,"For example 1,2,4 would cause selection attributes for service category,"
W !,"location, and patient sex to be established."
Q
;
;
;=======================================================================
ENTYPE ;Get the list of encounter types.
N DIEA,ENTYPE,IC,JC,NENTY,PCEENTY,VALID,X,Y
K DIRUT,DTOUT,DUOUT
;Build a list of allowed encounter types.
D HELP^DIE(9000010,"",15003,"S","ENTYPE")
S NENTY=ENTYPE("DIHELP")
S DIR("?")=" "
S DIR("?",1)="The possible encounter types for the report are:"
S JC=0
S PCEENTY=""
F IC=2:1:NENTY D
. S X=$P(ENTYPE("DIHELP",IC)," ",1)
. S PCEENTY=PCEENTY_X
. S JC=JC+1
. S DIR("?",JC)=ENTYPE("DIHELP",IC)
S NENTY=JC
S DIR("??")=U_"D ENTYHELP^PXRRECSC"
ENTTP ;
S DIR(0)="FU"_U_"1:"_NENTY
S DIR("A")="Select ENCOUNTER TYPES"
S DIR("B")="P"
W !
D ^DIR K DIR
I $D(DIROUT) S DTOUT=1
I $D(DTOUT)!($D(DUOUT)) Q
;Make sure we have a valid list.
S VALID=$$VLIST^PXRRGUT(PCEENTY,Y," is an invalid encounter type!")
I 'VALID G ENTTP
S PXRRENTY=$$UP^XLFSTR(Y)
Q
;
ENTYHELP ;?? help for encounter types.
W !!,"Enter the letter(s) corresponding to the desired encounter type or types."
W !,"For example POS would allow only encounters with encounter types of"
W !,"primary, occasion of service, and stop code to be included."
Q
;
;=======================================================================
SCAT ;Get the list of service categories.
N DIEA,IC,JC,NSC,PCESVC,SCA,VALID,X,Y
K DIRUT,DTOUT,DUOUT
;Build a list of allowed service categories. PCE uses a subset of the
;categories in the file. These are stored in PCESVC.
S PCESVC="AHITSEDX"
D HELP^DIE(9000010,"",.07,"S","SCA")
S NSC=SCA("DIHELP")
S DIR("?")=" "
S DIR("?",1)="The possible service categories for the report are:"
S JC=0
F IC=2:1:NSC D
. S X=$P(SCA("DIHELP",IC)," ",1)
. I PCESVC[X D
.. S JC=JC+1
.. S DIR("?",JC)=SCA("DIHELP",IC)
S NSC=JC
S DIR("??")=U_"D SCATHELP^PXRRECSC"
SCATP ;
S DIR(0)="FU"_U_"1:"_NSC
S DIR("A")="Select SERVICE CATEGORIES"
S DIR("B")="AI"
W !
D ^DIR K DIR
I $D(DIROUT) S DTOUT=1
I $D(DTOUT)!($D(DUOUT)) Q
;Make sure we have a valid list.
S VALID=$$VLIST^PXRRGUT(PCESVC,Y," is an invalid service category!")
I 'VALID G SCATP
S PXRRSCAT=$$UP^XLFSTR(Y)
Q
;
SCATHELP ;?? help for service categories.
W !!,"Enter the letter(s) corresponding to the desired service category or categories."
W !,"For example AHTE would allow only encounters with service categories of"
W !,"ambulatory, hospitalization, telecommunications, and event (historical) to be included."
Q
;
PXRRECSC ;ISL/PKR - PCE reports encounter selection criteria routines. ;7/7/97
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**12,18,20**;Aug 12, 1996
+2 ;
+3 ;=======================================================================
ECAT ;Get a list of attributes for screening encounters.
+1 NEW C2S,INDENT,VALID,X,Y
+2 KILL DIRUT,DTOUT,DUOUT
+3 SET DIR(0)="YA"
+4 SET DIR("A",1)="This report will include all VA clinic encounters for all patients"
+5 SET DIR("A",2)="unless you modify the criteria. Do you want to modify the criteria?"
+6 SET DIR("A")="Enter Y (YES) or N (NO) "
+7 SET DIR("B")="N"
+8 WRITE !
+9 DO ^DIR
KILL DIR
+10 IF $DATA(DIROUT)
SET DTOUT=1
+11 IF $DATA(DTOUT)!($DATA(DUOUT))
QUIT
+12 IF 'Y
SET PXRRECAT=""
QUIT
+13 ;
+14 SET INDENT=2
+15 SET C2S=INDENT+5
+16 KILL DIRUT,DUOUT
ECATP WRITE !!,"Encounters may be selected by any combination of the following attributes:"
+1 WRITE !,?INDENT,"1",?C2S,"Service Category"
+2 ;W !,?INDENT,"2",?C2S,"Encounter Type"
+3 WRITE !,?INDENT,"2",?C2S,"Location"
+4 WRITE !,?INDENT,"3",?C2S,"Provider"
+5 WRITE !,?INDENT,"4",?C2S,"Age of Patient"
+6 WRITE !,?INDENT,"5",?C2S,"Race of Patient"
+7 WRITE !,?INDENT,"6",?C2S,"Sex of Patient"
+8 SET DIR(0)="LAO"_U_"1:6"
+9 SET DIR("A")="Enter encounter selection attribute number(s) "
+10 SET DIR("?",1)="This response may be a single number, a list, or a range, e.g. 2 or 1,3 or 2-5."
+11 SET DIR("?")="The valid numbers are 1 through 6."
+12 SET DIR("??")=U_"D ECATHELP^PXRRECSC"
+13 DO ^DIR
KILL DIR
+14 IF $DATA(DIROUT)
SET DTOUT=1
+15 IF $DATA(DTOUT)
QUIT
+16 IF $DATA(DUOUT)
GOTO ECAT
+17 SET PXRRECAT=Y
+18 QUIT
+19 ;
ECATHELP ;
+1 WRITE !!,"Enter the number(s) corresponding to the desired selection attribute(s)."
+2 WRITE !,"For example 1,2,4 would cause selection attributes for service category,"
+3 WRITE !,"location, and patient sex to be established."
+4 QUIT
+5 ;
+6 ;
+7 ;=======================================================================
ENTYPE ;Get the list of encounter types.
+1 NEW DIEA,ENTYPE,IC,JC,NENTY,PCEENTY,VALID,X,Y
+2 KILL DIRUT,DTOUT,DUOUT
+3 ;Build a list of allowed encounter types.
+4 DO HELP^DIE(9000010,"",15003,"S","ENTYPE")
+5 SET NENTY=ENTYPE("DIHELP")
+6 SET DIR("?")=" "
+7 SET DIR("?",1)="The possible encounter types for the report are:"
+8 SET JC=0
+9 SET PCEENTY=""
+10 FOR IC=2:1:NENTY
Begin DoDot:1
+11 SET X=$PIECE(ENTYPE("DIHELP",IC)," ",1)
+12 SET PCEENTY=PCEENTY_X
+13 SET JC=JC+1
+14 SET DIR("?",JC)=ENTYPE("DIHELP",IC)
End DoDot:1
+15 SET NENTY=JC
+16 SET DIR("??")=U_"D ENTYHELP^PXRRECSC"
ENTTP ;
+1 SET DIR(0)="FU"_U_"1:"_NENTY
+2 SET DIR("A")="Select ENCOUNTER TYPES"
+3 SET DIR("B")="P"
+4 WRITE !
+5 DO ^DIR
KILL DIR
+6 IF $DATA(DIROUT)
SET DTOUT=1
+7 IF $DATA(DTOUT)!($DATA(DUOUT))
QUIT
+8 ;Make sure we have a valid list.
+9 SET VALID=$$VLIST^PXRRGUT(PCEENTY,Y," is an invalid encounter type!")
+10 IF 'VALID
GOTO ENTTP
+11 SET PXRRENTY=$$UP^XLFSTR(Y)
+12 QUIT
+13 ;
ENTYHELP ;?? help for encounter types.
+1 WRITE !!,"Enter the letter(s) corresponding to the desired encounter type or types."
+2 WRITE !,"For example POS would allow only encounters with encounter types of"
+3 WRITE !,"primary, occasion of service, and stop code to be included."
+4 QUIT
+5 ;
+6 ;=======================================================================
SCAT ;Get the list of service categories.
+1 NEW DIEA,IC,JC,NSC,PCESVC,SCA,VALID,X,Y
+2 KILL DIRUT,DTOUT,DUOUT
+3 ;Build a list of allowed service categories. PCE uses a subset of the
+4 ;categories in the file. These are stored in PCESVC.
+5 SET PCESVC="AHITSEDX"
+6 DO HELP^DIE(9000010,"",.07,"S","SCA")
+7 SET NSC=SCA("DIHELP")
+8 SET DIR("?")=" "
+9 SET DIR("?",1)="The possible service categories for the report are:"
+10 SET JC=0
+11 FOR IC=2:1:NSC
Begin DoDot:1
+12 SET X=$PIECE(SCA("DIHELP",IC)," ",1)
+13 IF PCESVC[X
Begin DoDot:2
+14 SET JC=JC+1
+15 SET DIR("?",JC)=SCA("DIHELP",IC)
End DoDot:2
End DoDot:1
+16 SET NSC=JC
+17 SET DIR("??")=U_"D SCATHELP^PXRRECSC"
SCATP ;
+1 SET DIR(0)="FU"_U_"1:"_NSC
+2 SET DIR("A")="Select SERVICE CATEGORIES"
+3 SET DIR("B")="AI"
+4 WRITE !
+5 DO ^DIR
KILL DIR
+6 IF $DATA(DIROUT)
SET DTOUT=1
+7 IF $DATA(DTOUT)!($DATA(DUOUT))
QUIT
+8 ;Make sure we have a valid list.
+9 SET VALID=$$VLIST^PXRRGUT(PCESVC,Y," is an invalid service category!")
+10 IF 'VALID
GOTO SCATP
+11 SET PXRRSCAT=$$UP^XLFSTR(Y)
+12 QUIT
+13 ;
SCATHELP ;?? help for service categories.
+1 WRITE !!,"Enter the letter(s) corresponding to the desired service category or categories."
+2 WRITE !,"For example AHTE would allow only encounters with service categories of"
+3 WRITE !,"ambulatory, hospitalization, telecommunications, and event (historical) to be included."
+4 QUIT
+5 ;