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

ADEPQA.m

Go to the documentation of this file.
  1. ADEPQA ; IHS/HQT/MJL - QA ENGINE ;11:07 AM [ 03/24/1999 9:04 AM ]
  1. ;;6.0;ADE;;APRIL 1999
  1. ;
  1. K ^ADEUTL("ADEPQA",$J),ADEEXT ;^ADEUTL is a transient working global
  1. N ADEHXO,ADEHXC,ADESTP,ADEDATE,ADEAGE,ADEPROV,ADEHYG,ADELOC,ADEJ,ADEROPT,ADETFIL,ADETNAM,ADETDFN,ADEADA,BY,FLDS,FR,TO,DIC,DHD,ZTSK
  1. CTRL D SEARCH G:$$HAT() END ;Set up Search parameters
  1. CTRL1 D OUTPUT^ADEPQA1B G:$$HAT() CTRL ;Select Output Format & template
  1. EN ;EP - Enter here with above predefined
  1. D ASKDEV^ADEPQA1B I POP K POP G END
  1. ;FHL 9/9/98 I $D(ZTSK) G END
  1. I $D(ZTQUEUED) G END
  1. ZTM ;EP -
  1. D ROLL ;$O through entries and screen accdng to criteria
  1. I '$D(^DIBT(ADETDFN,1)) G END ;W !,"NO MATCHES" G END ;Improve msg
  1. I '$D(ADEEXT) D PRINT ;Print Report
  1. ;
  1. END Q:$D(ADEEXT) ;ADEEXT means it's an external call which is
  1. ; doing its own device handling
  1. D ^%ZISC
  1. I $D(ZTQUEUED) D
  1. . D KILL^%ZTLOAD
  1. . I $D(ADETNAM),ADETNAM?1"ADEQA"1.5N D DELTMP(ADETDFN)
  1. I '$D(ZTQUEUED) D
  1. . ;FHL 9/9/98 I '$D(ZTSK),$D(ADETNAM),ADETNAM?1"ADEQA"1.5N D DELTMP(ADETDFN)
  1. . I '$D(ZTQUEUED),$D(ADETNAM),ADETNAM?1"ADEQA"1.5N D DELTMP(ADETDFN)
  1. Q
  1. ;
  1. PRINT ;
  1. N ADEDUZ,ADEY
  1. D EN1^DIP
  1. Q
  1. ;
  1. W !!,?5,"***STEP ONE: Select SEARCH PARAMETERS***"
  1. S ADESTP=$$STP^ADEPQA3() Q:$$HAT()
  1. SRCH1 S ADEDATE=$$DATE^ADEPQA3() G:$$HAT() SEARCH
  1. SRCH2 S ADEAGE=$$AGE^ADEPQA3() G:$$HAT() SRCH1
  1. SRCH3 S ADEPROV=$$PROV^ADEPQA3() G:$$HAT() SRCH2
  1. SRCH4 S ADEHYG=$$HYG^ADEPQA3() G:$$HAT() SRCH3
  1. SRCH5 S ADELOC=$$LOC^ADEPQA3() G:$$HAT() SRCH4
  1. F ADEJ=1:1:1 S ADEADA(ADEJ)=$$ADA^ADEPQA3A()
  1. G:$$HAT() SRCH5
  1. I '$$CHK^ADEPQA4() G SEARCH ;Ask user to verify search params
  1. Q
  1. ;
  1. ROLL ;EP - At this point, all variables needed to do the report are defined
  1. ;This subrtn $O's through ADEPCD using the DATE xref (or the PRO
  1. ;VIDER xref if it's provider-limited but not date-limited)
  1. ;Hits are stored in the template.
  1. N ADEHXC,ADEHXO
  1. I +ADESTP,$P(ADESTP,U,3)="9002007" D Q
  1. . N ADEDFN,ADESTD
  1. . S ADESTD=$P(ADESTP,U,2)
  1. . S ADEDFN=0
  1. . F S ADEDFN=$O(^DIBT(ADESTD,1,ADEDFN)) Q:'+ADEDFN D SCREEN(ADEDFN)
  1. I +ADESTP,$P(ADESTP,U,3)="9000001" D Q
  1. . N ADEDFN,ADESTD,ADEBEG,ADEND,ADEPAT
  1. . S ADESTD=$P(ADESTP,U,2)
  1. . S ADEPAT=0
  1. . S ADEND=$P(ADEDATE,U,3)
  1. . F S ADEPAT=$O(^DIBT(ADESTD,1,ADEPAT)) Q:'+ADEPAT S ADEBEG=$P(ADEDATE,U,2)-1 D
  1. . . F S ADEBEG=$O(^ADEPCD("DATE",ADEPAT,ADEBEG)) Q:'+ADEBEG Q:ADEBEG>ADEND S ADEDFN=0 D
  1. . . . F S ADEDFN=$O(^ADEPCD("DATE",ADEPAT,ADEBEG,ADEDFN)) Q:'+ADEDFN D SCREEN(ADEDFN)
  1. ;
  1. I +ADEDATE,$P(ADEROPT,U,2)'["PATIENT" D Q
  1. . N ADEBEG,ADEND,ADEDFN
  1. . S ADEBEG=$P(ADEDATE,U,2)-1,ADEND=$P(ADEDATE,U,3)
  1. . F S ADEBEG=$O(^ADEPCD("AC",ADEBEG)) Q:ADEBEG>ADEND Q:'+ADEBEG S ADEDFN=0 D
  1. . . F S ADEDFN=$O(^ADEPCD("AC",ADEBEG,ADEDFN)) Q:'ADEDFN D SCREEN(ADEDFN)
  1. I +ADEDATE,$P(ADEROPT,U,2)["PATIENT" D Q
  1. . N ADEBEG,ADEND,ADEDFN,ADEPAT
  1. . S ADEPAT=0
  1. . S ADEND=$P(ADEDATE,U,3)
  1. . F S ADEPAT=$O(^ADEPCD("DATE",ADEPAT)) Q:'+ADEPAT S ADEBEG=$P(ADEDATE,U,2)-1 D
  1. . . F S ADEBEG=$O(^ADEPCD("DATE",ADEPAT,ADEBEG)) Q:ADEBEG>ADEND Q:'+ADEBEG S ADEDFN=0 D
  1. . . . F S ADEDFN=$O(^ADEPCD("DATE",ADEPAT,ADEBEG,ADEDFN)) Q:'+ADEDFN D SCREEN(ADEDFN)
  1. Q
  1. K ADESTD,ADETFIL,ADETNAM ;*NE
  1. ;------->SUB-SUBROUTINES
  1. SCREEN(ADEDFN) ;
  1. ;Applies screens to ADEPCD entry ADEDFN
  1. N ADENOD
  1. S ADENOD=^ADEPCD(ADEDFN,0)
  1. I +ADESTP,$P(ADESTP,U,3)="9002007",'$$DATSCN^ADEPQA1C(ADENOD) Q
  1. I +ADEAGE,'$$AGESCN^ADEPQA1C(ADENOD) Q
  1. I +ADELOC,'$$LOCSCN^ADEPQA1C(ADENOD) Q
  1. I +ADEPROV,'$$PRVSCN^ADEPQA1C(ADENOD) Q
  1. I +ADEHYG,'$$HYGSCN^ADEPQA1C(ADENOD) Q
  1. I +ADEADA(1),'$$CODSCN^ADEPQA1D(ADEDFN) Q
  1. D HIT(ADEDFN)
  1. Q
  1. HIT(ADEDFN) ;
  1. ;Adds ADEDFN to whatever template we're using
  1. I $P(ADEROPT,U,2)="DENTAL" S ^DIBT(ADETDFN,1,ADEDFN)=""
  1. E S ^DIBT(ADETDFN,1,$P(^ADEPCD(ADEDFN,0),U))=""
  1. Q
  1. ;------->FUNCTIONS
  1. HAT() ;EP
  1. I $D(DTOUT)!($D(DUOUT))!($D(DIROUT)) Q 1
  1. Q 0
  1. ;
  1. TMPLAT(ADETNAM,ADETFIL) ;EP
  1. ;Creates entry in SORT TEMPLATE file attached to file # ADETFIL
  1. ;Returns template DFN
  1. N DIC,X,DD,D0,Y,DR,DO
  1. S DIC="^DIBT(",X=ADETNAM,DIC(0)="LZ",DIC("DR")="4///"_ADETFIL_";5///"_DUZ K DD,DO D FILE^DICN
  1. Q +Y
  1. ;
  1. ;
  1. DELTMP(ADETDFN) ;EP - Deletes template ADETDFN
  1. N DR,DA,DIE
  1. S DA=ADETDFN
  1. S DR=".01///@",DIE="^DIBT("
  1. D ^DIE
  1. Q