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

ACKQASU7.m

Go to the documentation of this file.
  1. ACKQASU7 ;HCIOFO/AG - New/Edit Visit Utilities ; 04/01/99
  1. ;;3.0;QUASAR;;Feb 11, 2000
  1. ;Per VHA Directive 10-93-142, this routine SHOULD NOT be modified.
  1. ;
  1. ;
  1. SHOWPCE(ACKGBL) ; display errors from COPYPCE stored in @ACKGBL
  1. ; this routine displays on the screen any errors found in the global
  1. ; referenced by ACKGBL that were created by COPYPCE^ACKQASU4.
  1. ; format for global is @ACKGBL=number or errors
  1. ; @ACKGBL@(n)=field^int^ext^message
  1. ; returns:- 0 - continue, 1 - user typed '^' to exit
  1. N ACKERR,ACKECT,ACKLN,ACKTMP,ACKFLD,ACKINT,ACKEXT,ACKMSG,ACKTXT,ACKLF
  1. N DIRUT,ACKTAB,ACKLEN
  1. ;
  1. ; get number of errors, initialise line counter
  1. S ACKERR=@ACKGBL,ACKLN=0
  1. ;
  1. ; show header
  1. W !!?2,"ERROR - The following errors occurred while copying the PCE Visit"
  1. W !?2,"data into QUASAR. The fields in error are displayed below with the"
  1. W !?2,"reason they were rejected.",!
  1. S ACKLN=6
  1. ;
  1. ; display the errors
  1. F ACKECT=1:1:ACKERR D Q:$D(DIRUT)
  1. . S ACKTMP=@ACKGBL@(ACKECT)
  1. . S ACKFLD=$P(ACKTMP,U,1),ACKINT=$P(ACKTMP,U,2),ACKEXT=$P(ACKTMP,U,3)
  1. . S ACKDTA=$S(ACKEXT="":ACKINT,1:ACKEXT)
  1. . S ACKTAB=$S($L(ACKDTA)>19:35,1:13+$L(ACKDTA)+2+5\5*5),ACKLEN=80-ACKTAB
  1. . W !?2,ACKFLD_":",?13,$E(ACKDTA,1,20)
  1. . S ACKMSG=$P(ACKTMP,U,4),ACKLF=0
  1. . F Q:ACKMSG="" D Q:$D(DIRUT)
  1. . . S ACKTXT=$E(ACKMSG,1,ACKLEN) D ; reset TXT (word wrap)
  1. . . . I ($E(ACKTXT,ACKLEN)?1P)!($E(ACKMSG,ACKLEN+1)?1P) Q
  1. . . . S ACKI=0 I $L(ACKTXT)=ACKLEN F ACKI=ACKLEN:-1:0 Q:$E(ACKTXT,ACKI)?1P
  1. . . . I ACKI S ACKTXT=$E(ACKTXT,1,ACKI) Q
  1. . . W:ACKLF ! W ?ACKTAB,ACKTXT S ACKLF=1
  1. . . S ACKLN=ACKLN+1 D PAUSE Q:$D(DIRUT)
  1. . . S ACKMSG=$P(ACKMSG,ACKTXT,2,999)
  1. . . F Q:$E(ACKMSG)'=" " S ACKMSG=$E(ACKMSG,2,999)
  1. ;
  1. ; all done
  1. I '$D(DIRUT) S ACKLN=0 D PAUSE
  1. ; return 1 if user chose to quit, 0 if they didn't
  1. Q $D(DIRUT)
  1. ;
  1. PAUSE ;
  1. Q:ACKLN#15'=0
  1. W !!
  1. K DIR S DIR(0)="E" D ^DIR K DIR ; Return to Continue '^' to Exit
  1. W !
  1. Q
  1. ;
  1. ACKAPMNT(ACKVD,ACKVTME,ACKCLIN,ACKPAT) ;
  1. ;
  1. ; //First checks to see if Patient is an Inpatient if they are then
  1. ; //dont display this message.
  1. ; Checks to see if the visit entered corresponds to a Visit Within
  1. ; Appointment Management. If does'nt a warning is displayed - the
  1. ; can continue or quit. This is to remind/encorage users to enter
  1. ; visits first through Appointment Management then pick them up
  1. ; in Quasar.
  1. ;
  1. ; N VAIN D INP^VADPT I $P(VAIN(4),U,2)'="" Q 1
  1. ;
  1. N ACKK1,ACKT,ACKOKAY
  1. I ACKVTME="" G MESSAG
  1. ;
  1. S DFN=ACKPAT,VASD("C",ACKCLIN)="",VASD("T")=ACKVD,VASD("F")=ACKVD
  1. S VASD("W")="129"
  1. K ^UTILITY("VASD",$J) D SDA^VADPT ; Call appointment utility
  1. I '$D(^UTILITY("VASD",$J)) G MESSAG ; Nothing returned=No appointment
  1. ;
  1. S ACKK1="",ACKOKAY=0
  1. F S ACKK1=$O(^UTILITY("VASD",$J,ACKK1)) Q:ACKK1=""!(ACKOKAY) D
  1. . S ACKT=$P(^UTILITY("VASD",$J,ACKK1,"I"),U,1)
  1. . S ACKT=$P(ACKT,".",2)
  1. . I ACKT=ACKVTME S ACKOKAY=1
  1. K ^UTILITY("VASD",$J)
  1. ;
  1. I ACKOKAY Q 1
  1. ;
  1. MESSAG ;
  1. W !!!,"WARNING -",!
  1. W !,"You are Creating a Visit that does not exist within Appointment Management."
  1. W !,"This Visit will not be displayed within Appointment Management.",!
  1. ;
  1. N DIR,DUOUT,DTOUT,DIRUT
  1. OK2 S DIR(0)="Y",DIR("B")="NO",DIR("A")="Do you want to Continue "
  1. S DIR("?")="Answer YES to continue with New Visit Entry or NO to quit."
  1. D ^DIR
  1. I Y?1"^"1.E W !,"Jumping not allowed.",! G OK2
  1. S:$D(DIRUT) Y=0
  1. S:$D(DTOUT) Y=0
  1. Q Y
  1. ;