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

SCUTIE2.m

Go to the documentation of this file.
  1. SCUTIE2 ;ALB/SCK - IEMM LIST MANAGER UTILITIES; 16-JUN-97
  1. ;;5.3;Scheduling;**66**;AUG 13, 1993
  1. ;
  1. Q
  1. 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
  1. ; the Transmitted OP ENC Error Code file.
  1. ;
  1. ; Input:
  1. ; SDYX - Pointer to return variable for the IEN of the selected Patient, Clinic, or Error code
  1. ;
  1. ; Sets SDENTYP as follows:
  1. ; P - Patient Selection
  1. ; C - Clinic Selection
  1. ; E - Error Code Selection
  1. ;
  1. S DIR(0)="FA",DIR("A")="Select Patient name, Clinic name, or Error Code: "
  1. S DIR("?")="Enter as P.patient name, C.clinic name, or E.error name"
  1. S DIR("??")="^D HELP^SCUTIE2"
  1. D ^DIR K DIR I $D(DIRUT) S VALMQUIT="" G ENQ
  1. ;
  1. I $E(Y,1,2)="P."!($E(Y,1,2)="p.") D G ENQ
  1. . S SDYX=$$LOOKUP($P(Y,".",2),2)
  1. . S SDENTYP="P"
  1. ;
  1. I $E(Y,1,2)="C."!($E(Y,1,2)="c.") D G ENQ
  1. . S SDYX=$$LOOKUP($P(Y,".",2),44)
  1. . S SDENTYP="C"
  1. ;
  1. I $E(Y,1,2)="E."!($E(Y,1,2)="e.") D G ENQ
  1. . S SDYX=$$LOOKUP($P(Y,".",2),409.76)
  1. . S SDENTYP="E"
  1. ;
  1. S SDYX=$$MULTLKUP(Y)
  1. ENQ Q $G(SDYX)>0
  1. ;
  1. LOOKUP(X,SCG) ; Look up IEN for the specified file
  1. ;
  1. ; Input:
  1. ; X - Lookup value for the DIC call
  1. ; SCG - The file to do the lookup on
  1. ;
  1. ; Returns Y = the IEN of the selected entry
  1. ;
  1. S DIC=SCG,DIC(0)="EMQ"
  1. D ^DIC
  1. Q $G(Y)
  1. ;
  1. 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
  1. ; a possible match.
  1. ;
  1. ; Input:
  1. ; SD1 - Lookup value
  1. ;
  1. ; Returns Y = The IEN of the selected entry
  1. ;
  1. N Y,X,SCVAL,DUOUT,DTOUT
  1. ;
  1. S SD1=$$UPPER^VALM1(SD1)
  1. ; First pass, try patient file for match
  1. W !!,"Searching for patient ",SD1
  1. K DIC S DIC=2,DIC(0)="EM",X=SD1
  1. D ^DIC K DIC
  1. I +Y>0 S SCVAL=$$OK
  1. E S SCVAL=0
  1. I $G(SCVAL)<0 Q -1
  1. I $G(SCVAL)'=0 S SDENTYP="P" G MLTQ
  1. ;
  1. ; Second pass, try hospital location file for match
  1. W !!,"Searching for Clinic ",SD1
  1. K DIC S DIC=44,DIC(0)="EM",X=SD1
  1. D ^DIC K DIC
  1. I +Y>0 S SCVAL=$$OK
  1. E S SCVAL=0
  1. I SCVAL<0 Q -1
  1. I SCVAL'=0 S SDENTYP="C" G MLTQ
  1. ;
  1. ; Final pass, try error file for match
  1. W !!,"Searching for Error Code ",SD1
  1. K DIC S DIC=409.76,DIC(0)="EM",X=SD1
  1. D ^DIC K DIC
  1. I +Y>0 S SCVAL=$$OK
  1. E S SCVAL=0
  1. I SCVAL<0 Q -1
  1. I SCVAL'=0 S SDENTYP="E" G MLTQ
  1. MLTQ Q $G(Y)
  1. ;
  1. OK() ; Ask user if displayed entry is ok for selection.
  1. ; Return 1 if Ok, 0 if not
  1. N Y
  1. K DIRUT,DIR
  1. W !
  1. S DIR(0)="SA^Y:Yes;N:No",DIR("A")=" ...OK? ",DIR("B")="Yes"
  1. S DIR("?")="Answer with Yes to accept, or No to ignore"
  1. D ^DIR K DIR
  1. Q $S($D(DIRUT):-1,1:Y="Y")
  1. ;
  1. HELP ;
  1. ;
  1. W !?2,"Enter P.patient name to select a specific patient,"
  1. W !?2,"C.clinic name to select a specific clinic, or E.Error Name"
  1. W !?2,"to select a specific error.",!
  1. W !?2,"If selecting a specific error by its description it may be"
  1. W !?2,"necessary to enter more than three characters(Ex. E.Abxxxx)."
  1. W !?2,"Because this is a descriptive field, case sensitivity applies.",!
  1. W !?2,"If just a name is entered, any matches will be displayed in"
  1. W !?2,"patient, clinic, error code order. You will have the option"
  1. W !?2,"of selecting or ignoring the choice.",!
  1. Q