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

ACKQRU.m

Go to the documentation of this file.
  1. ACKQRU ;AUG/JLTP BIR/PTD HCIOFO/AG-Support Routine for Reports ; 9/2/09 11:56am
  1. ;;3.0;QUASAR;**17**;Feb 11, 2000;Build 28
  1. ;Per VHA Directive 10-93-142, this routine SHOULD NOT be modified.
  1. DTRANGE ;
  1. BEGDT N ACKTMPB
  1. S DIR(0)="D^:"_DT_":AEXP",DIR("A")="Beginning Date"
  1. S DIR("?")="Enter the earliest date for which you want to see data"
  1. S DIR("??")="^S ACKQHLP=1 D ^ACKQHLP"
  1. D ^DIR K DIR
  1. I Y?1"^"1.E W !,"Jumping not allowed.",! G BEGDT
  1. Q:$D(DIRUT) S ACKBD=Y-.1,ACKXBD=$$NUMDT^ACKQUTL(Y),ACKTMPB=Y
  1. ;
  1. ENDDT ; S DIR(0)="D^"_(ACKBD+.1)_":"_DT_":AEXP",DIR("A")="Ending Date"
  1. S DIR(0)="D"
  1. S DIR("A")="Ending Date"
  1. S DIR("?")="Enter the latest date for which you want to see data"
  1. S DIR("??")="^S ACKQHLP=1 D ^ACKQHLP"
  1. D ^DIR K DIR
  1. I Y?1"^"1.E W !,"Jumping not allowed.",! G ENDDT
  1. Q:$D(DIRUT) S ACKED=Y+.9,ACKXED=$$NUMDT^ACKQUTL(Y)
  1. I Y<ACKTMPB W !,"End date cannot be before the Begin date.",! G ENDDT
  1. Q
  1. PARAMS ;
  1. ; this subroutine contains two standard prompts
  1. ; 1. Select a = AUDIOLOGY
  1. ; s = SPEECH PATHOLOGY
  1. ; b = BOTH
  1. ; 2. Choose 1 = ONE CLINICIAN
  1. ; 2 = ONE OTHER PROVIDER
  1. ; 3 = ONE STUDENT
  1. ; 4 = ALL CLINICIANS
  1. ; 5 = ALL OTHER PROVIDERS
  1. ; 6 = ALL STUDENTS
  1. ; it returns
  1. ; DIRUT=1 user chose to exit
  1. ; ACKASB response to prompt 1
  1. ; (A=audio, S=speech, B=Both)
  1. ; ACKSS response to prompt 2 (1-6)
  1. ; ACKSTF() array containing all selected staff
  1. ; where ACKSTF(n)=persons IEN on NEW PERSON FILE
  1. ;
  1. N DIR,I,X,Y,DIC,ACKQHLP
  1. ;
  1. ; prompt 1
  1. S DIR(0)="S^a:AUDIOLOGY;s:SPEECH PATHOLOGY;b:BOTH"
  1. S DIR("A")="Select",DIR("B")="BOTH"
  1. S DIR("??")="^W !!,""You can select Audiology visits, Speech Pathology visits, or Both."",!"
  1. D ^DIR K DIR Q:$D(DIRUT)
  1. S ACKASB=$S(Y="a":"A",Y="s":"S",1:"B")
  1. ;
  1. ; prompt 2
  1. S DIR(0)="S^1:ONE CLINICIAN;2:ONE OTHER PROVIDER;3:ONE STUDENT;4:ALL CLINICIANS;5:ALL OTHER PROVIDERS;6:ALL STUDENTS"
  1. S DIR("A")="Choose",DIR("??")="^S ACKQHLP=4 D ^ACKQHLP"
  1. D ^DIR K DIR Q:$D(DIRUT)
  1. S ACKSS=Y
  1. K ACKSTF
  1. ; if ONE staff member selected then ask for name
  1. I ACKSS<4 D Q:$D(DIRUT)
  1. . S DIC("A")="Select "_$S(ACKSS=1:"CLINICIAN",ACKSS=2:"OTHER PROVIDER",1:"STUDENT")_": "
  1. . S DIC(0)="AEMQZ",DIC=509850.3
  1. . S DIC("S")="I $P(^(0),U,2)]"""",$P(""CF^O^S"",U,ACKSS)[$P(^(0),U,2)"
  1. . D ^DIC K DIC S:Y<0 DIRUT=1 Q:$D(DIRUT)
  1. . ;*17 Update to correctly set DUZ
  1. . ;S ACKSTF(+Y)=$P(Y,U,2)
  1. . S ACKSTF(+Y)=$$CONVERT1^ACKQUTL4(+Y)
  1. ; if ALL staff selected then get them from staff file
  1. I ACKSS>3 D
  1. . S I=0 F S I=$O(^ACK(509850.3,I)) Q:'I D
  1. . . S X=$P(^ACK(509850.3,I,0),U,2)
  1. . . I X="" Q
  1. . . I ACKSS=4,"CF"'[X Q
  1. . . I ACKSS=5,X'="O" Q
  1. . . I ACKSS=6,X'="S" Q
  1. . . ;*17 Update to correctly set DUZ
  1. . . ;S ACKSTF(I)=$P(^ACK(509850.3,I,0),U)
  1. . . S ACKSTF(I)=$$CONVERT1^ACKQUTL4(I)
  1. ;
  1. ; end
  1. Q
  1. ;
  1. GETDIV(DIVARR,ACKSTA,ACKOPT) ; get all the Divisions and put them in DIVARR
  1. ; INPUT: DIVARR must be passed by reference
  1. ; ACKSTA division status (optional)
  1. ; 'A' will get active divisions only (default)
  1. ; 'I' will get inactive divisions only
  1. ; 'AI' or 'IA' will get all divisions
  1. ; ACKOPT options. so far the only option is 'U' to output the
  1. ; names in uppercase.
  1. ; RETURNS: DIVARR= number found (n)
  1. ; DIVARR(1,n)=x^y^name
  1. ; DIVARR(2,name)=n
  1. ; and DIVARR(3,x)=n
  1. ; where x=IEN of Div from Medical Center Division file
  1. ; and y=sequence number from A&SP Site Parameter file
  1. ; (in other words ^ACK(509850.8,1,2,y)=x^...)
  1. ; and name=the division name
  1. ;
  1. N ACKTGT,ACKMSG,ACKSCRN,ACK,SEQ,DIV,DIVNAME
  1. K DIVARR
  1. ; build screen based on requested status
  1. I $G(ACKSTA)="" S ACKSTA="A"
  1. S ACKSCRN="I """_ACKSTA_"""[$P(^(0),U,2)"
  1. ; go get 'em
  1. D LIST^DIC(509850.83,",1,",".01","I","*","","","",ACKSCRN,"","ACKTGT","ACKMSG")
  1. ; now transfer to output array
  1. S DIVARR=$P(ACKTGT("DILIST",0),U,1)
  1. FOR ACK=1:1:DIVARR D
  1. . S SEQ=ACKTGT("DILIST",2,ACK),DIV=ACKTGT("DILIST",1,ACK)
  1. . S DIVNAME=$$GET1^DIQ(40.8,DIV_",",.01)
  1. . S DIVARR(1,ACK)=DIV_U_SEQ_U_DIVNAME
  1. . S DIVARR(2,$$UP($G(ACKOPT),DIVNAME))=ACK
  1. . S DIVARR(3,DIV)=ACK
  1. Q
  1. UP(ACKOPT,X) ; convert X to uppercase (if requested)
  1. I ACKOPT["U" Q $TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
  1. Q X
  1. ;
  1. STOPSORT(ACKASB,ACKVSC) ; determine stop code sort value
  1. ; this function determines whether the Stop Code for the Visit is
  1. ; valid for the type of report selected.
  1. ; If it is not valid the function returns 0
  1. ; If it is valid the function returns an integer which may be used to
  1. ; sequence the visit so that Audio comes first, Audio/Tel next,
  1. ; then Speech and Speech/Tel.
  1. ; If an unknown Visit Stop Code is encountered, it is given a 9
  1. ; which means it will appear at the end of the report as UNKNOWN.
  1. I ACKVSC="A" Q $S(ACKASB="A":1,ACKASB="B":1,1:0) ; audiology #1
  1. I ACKVSC="AT" Q $S(ACKASB="A":2,ACKASB="B":2,1:0) ; telephone audiology #2
  1. I ACKVSC="S" Q $S(ACKASB="S":3,ACKASB="B":3,1:0) ; speech #3
  1. I ACKVSC="ST" Q $S(ACKASB="S":4,ACKASB="B":4,1:0) ; telephone speech #4
  1. Q 9 ; any other value 9
  1. ;
  1. STOPNM(ACKSORT) ; convert stop code sort value into a stop code name
  1. I ACKSORT=1 Q "AUDIOLOGY"
  1. I ACKSORT=2 Q "AUDIOLOGY TELEPHONE"
  1. I ACKSORT=3 Q "SPEECH PATHOLOGY"
  1. I ACKSORT=4 Q "SPEECH TELEPHONE"
  1. Q "UNKNOWN"
  1. ;