PXRMXSC ; SLC/PJH - Reminder reports service category selection ;12/18/2006
;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
;
SCAT ;Get the list of service categories.
N DIR,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=""
D HELP^DIE(9000010,"",.07,"S","SCA")
S NSC=SCA("DIHELP")
S DIR("?")=U_"D SCATHELP^PXRMXSC"
S DIR("??")=U_"D SCATHELP^PXRMXSC"
SCATP ;
S DIR(0)="FU"_U_"1:"_NSC
S DIR("A")="Select SERVICE CATEGORIES"
S DIR("B")="A,I"
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=$$VSCLIST(Y,PCESVC)
I 'VALID G SCATP
S PXRMSCAT=$$UP^XLFSTR(Y)
F IC=1:1:$L(PXRMSCAT,",") S X=$P(PXRMSCAT,",",IC),PXRMSCAT(X)=""
Q
;
;======================================================
SCATHELP ;? help for service categories.
N ARRAY,IC,JC,NSC,PCESVC
S PCESVC=""
D HELP^DIE(9000010,"",.07,"S","SCA")
S NSC=SCA("DIHELP")
S JC=0
F IC=2:1:NSC D
. S X=$P(SCA("DIHELP",IC)," ",1)
. I PCESVC="" S PCESVC=X
. E S PCESVC=PCESVC_","_X
. S JC=JC+1
. S ARRAY(JC)=SCA("DIHELP",IC)
S NSC=JC
W !!,"Enter the letter(s), separated by commas, corresponding to the desired service"
W !,"category or categories. For example A,H,T,E would allow only encounters with"
W !,"service categories of ambulatory, hospitalization, telecommunications, and"
W !,"event (historical) to be included."
W !!,"The possible service categories for the report are:",!
F IC=1:1:NSC W !,ARRAY(IC)
Q
;
;======================================================
VSCLIST(LIST,SLIST) ;LIST is a comma separated list of service categories. SLIST
;is the standard list of service categories. Make sure all the
;elements of LIST are in the standard list SLIST. If they are, then
;LIST is valid. Used for selection in reminder reports and as input
;transform SERVICE CATEGORY LIST in the REMINDER REPORT TEMPLATE
;file #810.1.
I LIST="" Q 1
I $G(SLIST)="" D
. N IC,SCA,TEMP
. D HELP^DIE(9000010,"",.07,"S","SCA")
. S SLIST=""
. F IC=2:1:SCA("DIHELP") D
.. S TEMP=$P(SCA("DIHELP",IC)," ",1)
.. I SLIST="" S SLIST=TEMP
.. E S SLIST=SLIST_","_TEMP
N IC,LE,LEN,VALID
S LIST=$$UP^XLFSTR(LIST)
S VALID=1
S LEN=$L(LIST,",")
F IC=1:1:LEN D
. S LE=$P(LIST,",",IC)
. I LE="" D Q
.. D EN^DDIOL("Null is not a valid service category!")
.. S VALID=0
. I SLIST'[LE D
.. D EN^DDIOL(LE_" is an invalid service category!")
.. S VALID=0
Q VALID
;
PXRMXSC ; SLC/PJH - Reminder reports service category selection ;12/18/2006
+1 ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
+2 ;
SCAT ;Get the list of service categories.
+1 NEW DIR,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=""
+6 DO HELP^DIE(9000010,"",.07,"S","SCA")
+7 SET NSC=SCA("DIHELP")
+8 SET DIR("?")=U_"D SCATHELP^PXRMXSC"
+9 SET DIR("??")=U_"D SCATHELP^PXRMXSC"
SCATP ;
+1 SET DIR(0)="FU"_U_"1:"_NSC
+2 SET DIR("A")="Select SERVICE CATEGORIES"
+3 SET DIR("B")="A,I"
+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=$$VSCLIST(Y,PCESVC)
+10 IF 'VALID
GOTO SCATP
+11 SET PXRMSCAT=$$UP^XLFSTR(Y)
+12 FOR IC=1:1:$LENGTH(PXRMSCAT,",")
SET X=$PIECE(PXRMSCAT,",",IC)
SET PXRMSCAT(X)=""
+13 QUIT
+14 ;
+15 ;======================================================
SCATHELP ;? help for service categories.
+1 NEW ARRAY,IC,JC,NSC,PCESVC
+2 SET PCESVC=""
+3 DO HELP^DIE(9000010,"",.07,"S","SCA")
+4 SET NSC=SCA("DIHELP")
+5 SET JC=0
+6 FOR IC=2:1:NSC
Begin DoDot:1
+7 SET X=$PIECE(SCA("DIHELP",IC)," ",1)
+8 IF PCESVC=""
SET PCESVC=X
+9 IF '$TEST
SET PCESVC=PCESVC_","_X
+10 SET JC=JC+1
+11 SET ARRAY(JC)=SCA("DIHELP",IC)
End DoDot:1
+12 SET NSC=JC
+13 WRITE !!,"Enter the letter(s), separated by commas, corresponding to the desired service"
+14 WRITE !,"category or categories. For example A,H,T,E would allow only encounters with"
+15 WRITE !,"service categories of ambulatory, hospitalization, telecommunications, and"
+16 WRITE !,"event (historical) to be included."
+17 WRITE !!,"The possible service categories for the report are:",!
+18 FOR IC=1:1:NSC
WRITE !,ARRAY(IC)
+19 QUIT
+20 ;
+21 ;======================================================
VSCLIST(LIST,SLIST) ;LIST is a comma separated list of service categories. SLIST
+1 ;is the standard list of service categories. Make sure all the
+2 ;elements of LIST are in the standard list SLIST. If they are, then
+3 ;LIST is valid. Used for selection in reminder reports and as input
+4 ;transform SERVICE CATEGORY LIST in the REMINDER REPORT TEMPLATE
+5 ;file #810.1.
+6 IF LIST=""
QUIT 1
+7 IF $GET(SLIST)=""
Begin DoDot:1
+8 NEW IC,SCA,TEMP
+9 DO HELP^DIE(9000010,"",.07,"S","SCA")
+10 SET SLIST=""
+11 FOR IC=2:1:SCA("DIHELP")
Begin DoDot:2
+12 SET TEMP=$PIECE(SCA("DIHELP",IC)," ",1)
+13 IF SLIST=""
SET SLIST=TEMP
+14 IF '$TEST
SET SLIST=SLIST_","_TEMP
End DoDot:2
End DoDot:1
+15 NEW IC,LE,LEN,VALID
+16 SET LIST=$$UP^XLFSTR(LIST)
+17 SET VALID=1
+18 SET LEN=$LENGTH(LIST,",")
+19 FOR IC=1:1:LEN
Begin DoDot:1
+20 SET LE=$PIECE(LIST,",",IC)
+21 IF LE=""
Begin DoDot:2
+22 DO EN^DDIOL("Null is not a valid service category!")
+23 SET VALID=0
End DoDot:2
QUIT
+24 IF SLIST'[LE
Begin DoDot:2
+25 DO EN^DDIOL(LE_" is an invalid service category!")
+26 SET VALID=0
End DoDot:2
End DoDot:1
+27 QUIT VALID
+28 ;