NURSAGP3 ;HISC/MD-MULTIPLE SERVICE CATEGORY SELECTION UTILITY ;4/17/97
;;4.0;NURSING SERVICE;;Apr 25, 1997
; This routine allows a user to select one or more of the service
; category(ies) at one time:
; The user's selections are returned in a global array
; TMP("NURSCAT",$J,Free-Text service category name)=""
EN1 ; SELECT SERVICE CATEGORY
N DA,Y,X
K NUROUT,^TMP("NURSCAT",$J)
D DISP I $O(^TMP("NURSCAT",$J,0))="" S NUROUT=1
QUIT K NURSTAB,NURS,NURSAQ,NURSND,DIC,NURSCAT,DLAYGO,I,NURSMAX,NURSCLA,NURSCNT,NURSI,NURSMI
Q
DISP ;
; Define list of user selectable service category(ies) from the
; NURS Service Positon (#211.3) File.
;
K NURSTAB,NURSCAT S NURSX="",NURSMAX=0
F NURSX="R (RN-REGISTERED NURSE)","L (LPN-LIC. PRACTICAL NURSE)","N (NA-NURSING ASSISTANT)","C (CK-CLERICAL)","S (SE-SUMMER EMPLOYEE)","A (AO-ADMIN. OFFICER)","O (OT-OTHER)" D
. I $G(NRNLPN)'="",'(NURSX["(RN-"),'(NURSX["(LPN-") Q
. S NURSMAX=NURSMAX+1,NURSCAT(NURSMAX)=NURSX
. Q
S NURSX="" F S NURSX=$O(^NURSF(211.3,"F",NURSX)) Q:NURSX="" S DA=$O(^NURSF(211.3,"F",NURSX,0)) I '$G(NRNLPN) D
. S NURSMAX=NURSMAX+1,NURSCAT(NURSMAX)=$$UP^XLFSTR(NURSX)
. Q
S NURSMAX=NURSMAX+1,NURSCAT(NURSMAX)="ALL"
S NURSTRT=1,(NUROUT,NURSDONE)=0
F D DSP I $G(NURSDONE)!$G(NUROUT) Q
Q
DSP ;
; Display the list of selectable service category(ies) from file 211.3.
;
W @IOF W !,$S('($G(NURSI)>7):"NURSING Service Categories",1:"OTHER Service Categories"),!,$$REPEAT^XLFSTR("-",26) S NURSAQ=$Y
F NURS=NURSTRT:1:NURSMAX S NURSI=NURS D I $Y>(IOSL+NURSAQ-10),NURS'=NURSMAX S NURSTRT=NURS+1 Q
. Q:$D(NURSCAT(NURSI))[0
. I NURSI=8 W !!,"OTHER Service Categories",!,$$REPEAT^XLFSTR("-",24)
. W ! W:$G(NURSCAT(NURSI))'="" ?1,$J(NURSI,2),". ",$G(NURSCAT(NURSI))
. Q
S NURSDONE=(NURS=NURSMAX)
I 'NURSDONE W !!,"<<More>>",! S DIR(0)="E" D ^DIR I $G(DIRUT) S NUROUT=1 Q
G:NUROUT QUIT
I 'NURSDONE G DSP
ASK ;
; Interactive user service category selection.
;
W !!,"Select SERVICE CATEGORY: " R NURSX:DTIME
S:'$T NURSX="^" I "^"[NURSX S:$E(NURSX)="^" NUROUT=1 Q
I NURSX=NURSMAX!($$UP^XLFSTR(NURSX)="ALL") S NURSX="1"_$S(NURSMAX>2:"-"_(NURSMAX-1),1:"")
D:'(NURSX?2."?") VALENT^NURSUT4 I (NURSX["?"!($G(NURSBAD))) S:NURSX?2."?" (NURSTRT,NURSI)=1 G DSP:NURSX?2."?",ASK
K ^TMP("NURSCAT") F NURSI=1:1 S NURSCLA=$P(NURSX,",",NURSI) Q:NURSCLA="" S NURSND=$P(NURSCLA,"-",2)_"+"_NURSCLA F NURSCNT=+NURSCLA:1:NURSND I +$G(NURSCAT(NURSCNT))'="" D
. S X=NURSCAT(NURSCNT),Y=$S(X["(RN-":"R",X["(LPN-":"L",X["(NA-":"N",X["(CK-":"C",X["(SE-":"S",X["AO-":"A",X["OT-":"O",1:X)
. S ^TMP("NURSCAT",$J,Y)=""
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HNURSAGP3 2637 printed Nov 22, 2024@17:31:31 Page 2
NURSAGP3 ;HISC/MD-MULTIPLE SERVICE CATEGORY SELECTION UTILITY ;4/17/97
+1 ;;4.0;NURSING SERVICE;;Apr 25, 1997
+2 ; This routine allows a user to select one or more of the service
+3 ; category(ies) at one time:
+4 ; The user's selections are returned in a global array
+5 ; TMP("NURSCAT",$J,Free-Text service category name)=""
EN1 ; SELECT SERVICE CATEGORY
+1 NEW DA,Y,X
+2 KILL NUROUT,^TMP("NURSCAT",$JOB)
+3 DO DISP
IF $ORDER(^TMP("NURSCAT",$JOB,0))=""
SET NUROUT=1
QUIT KILL NURSTAB,NURS,NURSAQ,NURSND,DIC,NURSCAT,DLAYGO,I,NURSMAX,NURSCLA,NURSCNT,NURSI,NURSMI
+1 QUIT
DISP ;
+1 ; Define list of user selectable service category(ies) from the
+2 ; NURS Service Positon (#211.3) File.
+3 ;
+4 KILL NURSTAB,NURSCAT
SET NURSX=""
SET NURSMAX=0
+5 FOR NURSX="R (RN-REGISTERED NURSE)","L (LPN-LIC. PRACTICAL NURSE)","N (NA-NURSING ASSISTANT)","C (CK-CLERICAL)","S (SE-SUMMER EMPLOYEE)","A (AO-ADMIN. OFFICER)","O (OT-OTHER)"
Begin DoDot:1
+6 IF $GET(NRNLPN)'=""
IF '(NURSX["(RN-")
IF '(NURSX["(LPN-")
QUIT
+7 SET NURSMAX=NURSMAX+1
SET NURSCAT(NURSMAX)=NURSX
+8 QUIT
End DoDot:1
+9 SET NURSX=""
FOR
SET NURSX=$ORDER(^NURSF(211.3,"F",NURSX))
if NURSX=""
QUIT
SET DA=$ORDER(^NURSF(211.3,"F",NURSX,0))
IF '$GET(NRNLPN)
Begin DoDot:1
+10 SET NURSMAX=NURSMAX+1
SET NURSCAT(NURSMAX)=$$UP^XLFSTR(NURSX)
+11 QUIT
End DoDot:1
+12 SET NURSMAX=NURSMAX+1
SET NURSCAT(NURSMAX)="ALL"
+13 SET NURSTRT=1
SET (NUROUT,NURSDONE)=0
+14 FOR
DO DSP
IF $GET(NURSDONE)!$GET(NUROUT)
QUIT
+15 QUIT
DSP ;
+1 ; Display the list of selectable service category(ies) from file 211.3.
+2 ;
+3 WRITE @IOF
WRITE !,$SELECT('($GET(NURSI)>7):"NURSING Service Categories",1:"OTHER Service Categories"),!,$$REPEAT^XLFSTR("-",26)
SET NURSAQ=$Y
+4 FOR NURS=NURSTRT:1:NURSMAX
SET NURSI=NURS
Begin DoDot:1
+5 if $DATA(NURSCAT(NURSI))[0
QUIT
+6 IF NURSI=8
WRITE !!,"OTHER Service Categories",!,$$REPEAT^XLFSTR("-",24)
+7 WRITE !
if $GET(NURSCAT(NURSI))'=""
WRITE ?1,$JUSTIFY(NURSI,2),". ",$GET(NURSCAT(NURSI))
+8 QUIT
End DoDot:1
IF $Y>(IOSL+NURSAQ-10)
IF NURS'=NURSMAX
SET NURSTRT=NURS+1
QUIT
+9 SET NURSDONE=(NURS=NURSMAX)
+10 IF 'NURSDONE
WRITE !!,"<<More>>",!
SET DIR(0)="E"
DO ^DIR
IF $GET(DIRUT)
SET NUROUT=1
QUIT
+11 if NUROUT
GOTO QUIT
+12 IF 'NURSDONE
GOTO DSP
ASK ;
+1 ; Interactive user service category selection.
+2 ;
+3 WRITE !!,"Select SERVICE CATEGORY: "
READ NURSX:DTIME
+4 if '$TEST
SET NURSX="^"
IF "^"[NURSX
if $EXTRACT(NURSX)="^"
SET NUROUT=1
QUIT
+5 IF NURSX=NURSMAX!($$UP^XLFSTR(NURSX)="ALL")
SET NURSX="1"_$SELECT(NURSMAX>2:"-"_(NURSMAX-1),1:"")
+6 if '(NURSX?2."?")
DO VALENT^NURSUT4
IF (NURSX["?"!($GET(NURSBAD)))
if NURSX?2."?"
SET (NURSTRT,NURSI)=1
if NURSX?2."?"
GOTO DSP
GOTO ASK
+7 KILL ^TMP("NURSCAT")
FOR NURSI=1:1
SET NURSCLA=$PIECE(NURSX,",",NURSI)
if NURSCLA=""
QUIT
SET NURSND=$PIECE(NURSCLA,"-",2)_"+"_NURSCLA
FOR NURSCNT=+NURSCLA:1:NURSND
IF +$GET(NURSCAT(NURSCNT))'=""
Begin DoDot:1
+8 SET X=NURSCAT(NURSCNT)
SET Y=$SELECT(X["(RN-":"R",X["(LPN-":"L",X["(NA-":"N",X["(CK-":"C",X["(SE-":"S",X["AO-":"A",X["OT-":"O",1:X)
+9 SET ^TMP("NURSCAT",$JOB,Y)=""
End DoDot:1
+10 QUIT