SCUTIE2 ;ALB/SCK - IEMM LIST MANAGER UTILITIES; 16-JUN-97
;;5.3;Scheduling;**66,1015**;AUG 13, 1993;Build 21
;
Q
ENTRY(SDYX) ; Get entry for incomplete encounter lookup. Mimics the selection process in
; Appointment Management, but allows for the additional selection of an error code from
; the Transmitted OP ENC Error Code file.
;
; Input:
; SDYX - Pointer to return variable for the IEN of the selected Patient, Clinic, or Error code
;
; Sets SDENTYP as follows:
; P - Patient Selection
; C - Clinic Selection
; E - Error Code Selection
;
S DIR(0)="FA",DIR("A")="Select Patient name, Clinic name, or Error Code: "
S DIR("?")="Enter as P.patient name, C.clinic name, or E.error name"
S DIR("??")="^D HELP^SCUTIE2"
D ^DIR K DIR I $D(DIRUT) S VALMQUIT="" G ENQ
;
I $E(Y,1,2)="P."!($E(Y,1,2)="p.") D G ENQ
. S SDYX=$$LOOKUP($P(Y,".",2),2)
. S SDENTYP="P"
;
I $E(Y,1,2)="C."!($E(Y,1,2)="c.") D G ENQ
. S SDYX=$$LOOKUP($P(Y,".",2),44)
. S SDENTYP="C"
;
I $E(Y,1,2)="E."!($E(Y,1,2)="e.") D G ENQ
. S SDYX=$$LOOKUP($P(Y,".",2),409.76)
. S SDENTYP="E"
;
S SDYX=$$MULTLKUP(Y)
ENQ Q $G(SDYX)>0
;
LOOKUP(X,SCG) ; Look up IEN for the specified file
;
; Input:
; X - Lookup value for the DIC call
; SCG - The file to do the lookup on
;
; Returns Y = the IEN of the selected entry
;
S DIC=SCG,DIC(0)="EMQ"
D ^DIC
Q $G(Y)
;
MULTLKUP(SD1) ; Lookup entry for unspecified selection file. Try searching the patient
; file, hospital location file, and the transmitted OP ENC error code file for
; a possible match.
;
; Input:
; SD1 - Lookup value
;
; Returns Y = The IEN of the selected entry
;
N Y,X,SCVAL,DUOUT,DTOUT
;
S SD1=$$UPPER^VALM1(SD1)
; First pass, try patient file for match
W !!,"Searching for patient ",SD1
K DIC S DIC=2,DIC(0)="EM",X=SD1
D ^DIC K DIC
I +Y>0 S SCVAL=$$OK
E S SCVAL=0
I $G(SCVAL)<0 Q -1
I $G(SCVAL)'=0 S SDENTYP="P" G MLTQ
;
; Second pass, try hospital location file for match
W !!,"Searching for Clinic ",SD1
K DIC S DIC=44,DIC(0)="EM",X=SD1
D ^DIC K DIC
I +Y>0 S SCVAL=$$OK
E S SCVAL=0
I SCVAL<0 Q -1
I SCVAL'=0 S SDENTYP="C" G MLTQ
;
; Final pass, try error file for match
W !!,"Searching for Error Code ",SD1
K DIC S DIC=409.76,DIC(0)="EM",X=SD1
D ^DIC K DIC
I +Y>0 S SCVAL=$$OK
E S SCVAL=0
I SCVAL<0 Q -1
I SCVAL'=0 S SDENTYP="E" G MLTQ
MLTQ Q $G(Y)
;
OK() ; Ask user if displayed entry is ok for selection.
; Return 1 if Ok, 0 if not
N Y
K DIRUT,DIR
W !
S DIR(0)="SA^Y:Yes;N:No",DIR("A")=" ...OK? ",DIR("B")="Yes"
S DIR("?")="Answer with Yes to accept, or No to ignore"
D ^DIR K DIR
Q $S($D(DIRUT):-1,1:Y="Y")
;
HELP ;
;
W !?2,"Enter P.patient name to select a specific patient,"
W !?2,"C.clinic name to select a specific clinic, or E.Error Name"
W !?2,"to select a specific error.",!
W !?2,"If selecting a specific error by its description it may be"
W !?2,"necessary to enter more than three characters(Ex. E.Abxxxx)."
W !?2,"Because this is a descriptive field, case sensitivity applies.",!
W !?2,"If just a name is entered, any matches will be displayed in"
W !?2,"patient, clinic, error code order. You will have the option"
W !?2,"of selecting or ignoring the choice.",!
Q
SCUTIE2 ;ALB/SCK - IEMM LIST MANAGER UTILITIES; 16-JUN-97
+1 ;;5.3;Scheduling;**66,1015**;AUG 13, 1993;Build 21
+2 ;
+3 QUIT
ENTRY(SDYX) ; Get entry for incomplete encounter lookup. Mimics the selection process in
+1 ; Appointment Management, but allows for the additional selection of an error code from
+2 ; the Transmitted OP ENC Error Code file.
+3 ;
+4 ; Input:
+5 ; SDYX - Pointer to return variable for the IEN of the selected Patient, Clinic, or Error code
+6 ;
+7 ; Sets SDENTYP as follows:
+8 ; P - Patient Selection
+9 ; C - Clinic Selection
+10 ; E - Error Code Selection
+11 ;
+12 SET DIR(0)="FA"
SET DIR("A")="Select Patient name, Clinic name, or Error Code: "
+13 SET DIR("?")="Enter as P.patient name, C.clinic name, or E.error name"
+14 SET DIR("??")="^D HELP^SCUTIE2"
+15 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
SET VALMQUIT=""
GOTO ENQ
+16 ;
+17 IF $EXTRACT(Y,1,2)="P."!($EXTRACT(Y,1,2)="p.")
Begin DoDot:1
+18 SET SDYX=$$LOOKUP($PIECE(Y,".",2),2)
+19 SET SDENTYP="P"
End DoDot:1
GOTO ENQ
+20 ;
+21 IF $EXTRACT(Y,1,2)="C."!($EXTRACT(Y,1,2)="c.")
Begin DoDot:1
+22 SET SDYX=$$LOOKUP($PIECE(Y,".",2),44)
+23 SET SDENTYP="C"
End DoDot:1
GOTO ENQ
+24 ;
+25 IF $EXTRACT(Y,1,2)="E."!($EXTRACT(Y,1,2)="e.")
Begin DoDot:1
+26 SET SDYX=$$LOOKUP($PIECE(Y,".",2),409.76)
+27 SET SDENTYP="E"
End DoDot:1
GOTO ENQ
+28 ;
+29 SET SDYX=$$MULTLKUP(Y)
ENQ QUIT $GET(SDYX)>0
+1 ;
LOOKUP(X,SCG) ; Look up IEN for the specified file
+1 ;
+2 ; Input:
+3 ; X - Lookup value for the DIC call
+4 ; SCG - The file to do the lookup on
+5 ;
+6 ; Returns Y = the IEN of the selected entry
+7 ;
+8 SET DIC=SCG
SET DIC(0)="EMQ"
+9 DO ^DIC
+10 QUIT $GET(Y)
+11 ;
MULTLKUP(SD1) ; Lookup entry for unspecified selection file. Try searching the patient
+1 ; file, hospital location file, and the transmitted OP ENC error code file for
+2 ; a possible match.
+3 ;
+4 ; Input:
+5 ; SD1 - Lookup value
+6 ;
+7 ; Returns Y = The IEN of the selected entry
+8 ;
+9 NEW Y,X,SCVAL,DUOUT,DTOUT
+10 ;
+11 SET SD1=$$UPPER^VALM1(SD1)
+12 ; First pass, try patient file for match
+13 WRITE !!,"Searching for patient ",SD1
+14 KILL DIC
SET DIC=2
SET DIC(0)="EM"
SET X=SD1
+15 DO ^DIC
KILL DIC
+16 IF +Y>0
SET SCVAL=$$OK
+17 IF '$TEST
SET SCVAL=0
+18 IF $GET(SCVAL)<0
QUIT -1
+19 IF $GET(SCVAL)'=0
SET SDENTYP="P"
GOTO MLTQ
+20 ;
+21 ; Second pass, try hospital location file for match
+22 WRITE !!,"Searching for Clinic ",SD1
+23 KILL DIC
SET DIC=44
SET DIC(0)="EM"
SET X=SD1
+24 DO ^DIC
KILL DIC
+25 IF +Y>0
SET SCVAL=$$OK
+26 IF '$TEST
SET SCVAL=0
+27 IF SCVAL<0
QUIT -1
+28 IF SCVAL'=0
SET SDENTYP="C"
GOTO MLTQ
+29 ;
+30 ; Final pass, try error file for match
+31 WRITE !!,"Searching for Error Code ",SD1
+32 KILL DIC
SET DIC=409.76
SET DIC(0)="EM"
SET X=SD1
+33 DO ^DIC
KILL DIC
+34 IF +Y>0
SET SCVAL=$$OK
+35 IF '$TEST
SET SCVAL=0
+36 IF SCVAL<0
QUIT -1
+37 IF SCVAL'=0
SET SDENTYP="E"
GOTO MLTQ
MLTQ QUIT $GET(Y)
+1 ;
OK() ; Ask user if displayed entry is ok for selection.
+1 ; Return 1 if Ok, 0 if not
+2 NEW Y
+3 KILL DIRUT,DIR
+4 WRITE !
+5 SET DIR(0)="SA^Y:Yes;N:No"
SET DIR("A")=" ...OK? "
SET DIR("B")="Yes"
+6 SET DIR("?")="Answer with Yes to accept, or No to ignore"
+7 DO ^DIR
KILL DIR
+8 QUIT $SELECT($DATA(DIRUT):-1,1:Y="Y")
+9 ;
HELP ;
+1 ;
+2 WRITE !?2,"Enter P.patient name to select a specific patient,"
+3 WRITE !?2,"C.clinic name to select a specific clinic, or E.Error Name"
+4 WRITE !?2,"to select a specific error.",!
+5 WRITE !?2,"If selecting a specific error by its description it may be"
+6 WRITE !?2,"necessary to enter more than three characters(Ex. E.Abxxxx)."
+7 WRITE !?2,"Because this is a descriptive field, case sensitivity applies.",!
+8 WRITE !?2,"If just a name is entered, any matches will be displayed in"
+9 WRITE !?2,"patient, clinic, error code order. You will have the option"
+10 WRITE !?2,"of selecting or ignoring the choice.",!
+11 QUIT