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

ADEPENDA.m

Go to the documentation of this file.
ADEPENDA ; IHS/HQT/MJL  - ENDO REPORT PT 2 ;09:45 AM  [ 03/24/1999   9:04 AM ]
 ;;6.0;ADE;;APRIL 1999
GRP ;EP - Sets up code and opsite groups
 S ADECOD("ACCESSED")=$$ADACOD("3300,3301,3302,3303")
 S ADECOD("EXTRACTED")=$$ADACOD($$GROUP("EXTRACTIONS"))
 S ADECOD("COMPLETED")=$$ADACOD("3310,3311,3320,3321,3330,3331")
 S ADECOD("RESTORED")=$$ADACOD($$GROUP("RESTORATIONS-PERMANENT TOOTH"))
 S ADECOD("CROWNED")=$$ADACOD($$GROUP("CROWNS-PERMANENT TOOTH"))
 S ADEOP("FIRST MOLARS")=$$OPCOD("3,14,19,30")
 S ADEOP("PREMOLARS")=$$OPCOD($$GROUP("PERMANENT PREMOLARS"))
 S ADEOP("ANTERIORS")=$$OPCOD($$GROUP("PERMANENT ANTERIORS"))
 S ADEOP("OTHER MOLARS")=$$OPCOD("1,2,15,16,17,18,31,32")
 Q
 ;
GROUP(ADENAM) ;EP - Retuns code group ADENAM from ^ADEDIT("GRP")
 ;And translates any |'s to commas
 S ADENAM=$O(^ADEDIT("GRP","B",ADENAM,0))
 S ADENAM=$P(^ADEDIT("GRP",ADENAM,1),U)
 S ADENAM=$TR(ADENAM,"|",",")
 Q ADENAM
 ;
ADACOD(ADECOD) ;EP - Given "ADA CODE,ADA CODE,...ADA CODE"
 ;Returns "COD DFN,CODE DFN,...CODE DFN"
 N ADEDFN,ADEJ,ADEPC
 S ADEDFN=""
 F ADEJ=1:1:$L(ADECOD,",") S ADEPC=$P(ADECOD,",",ADEJ) D
 . S ADEPC=$O(^AUTTADA("B",ADEPC,0))
 . Q:ADEPC=""
 . I ADEDFN="" S ADEDFN=ADEPC Q
 . S $P(ADEDFN,",",ADEJ)=ADEPC
 Q ADEDFN
 ;
OPCOD(ADEOP) ;EP - Given "OPSITE,OPSITE,...OPSITE"
 ;Returns "OP DFN,OP DFN,...OP DFN"
 N ADEDFN,ADEJ,ADEPC
 S ADEDFN=""
 F ADEJ=1:1:$L(ADEOP,",") S ADEPC=$P(ADEOP,",",ADEJ) D
 . S ADEPC=$O(^ADEOPS("B",ADEPC,0))
 . Q:ADEPC=""
 . I ADEDFN="" S ADEDFN=ADEPC Q
 . S $P(ADEDFN,",",ADEJ)=ADEPC
 Q ADEDFN
DDS() ;EP
 ;Returns "1/0^DFN,DFN,DFN"
 ;ALSO SETS UP ARRAY ADEHNAM(DFN)="DENTIST,NAME"
 N ADEHYG,ADEJ
 S ADEHYG=""
 S ADEJ=0
 F  S ADEJ=$O(^DIC(6,ADEJ)) Q:'+ADEJ  D
 . I $P(^DIC(6,ADEJ,0),U,4)]"",$D(^DIC(7,$P(^DIC(6,ADEJ,0),U,4),9999999)),+^DIC(7,$P(^DIC(6,ADEJ,0),U,4),9999999)=52 D
 . . I ADEHYG="" S ADEHYG=ADEJ Q
 . . S $P(ADEHYG,",",$L(ADEHYG,",")+1)=ADEJ
 I ADEHYG="" Q 0
 F ADEJ=1:1:$L(ADEHYG,",") S ADEHNAM($P(ADEHYG,",",ADEJ))=$P(^DIC(16,$P(ADEHYG,",",ADEJ),0),U)
 S ADEHYG="1^"_ADEHYG
 Q ADEHYG
 ;
ADEU() ;GET UNIQUE SUBSCRIPT NUMBER AND LOCK REPORT NODE
 ;RETURNS SUBSCRIPT NUMBER
 S ADEU=$J
ADEU1 F  L +^TMP("ADEPEND",ADEU):.1 Q:$T  S ADEU=ADEU+1
 I $G(^TMP("ADEPEND",ADEU))="RUNNING" L -^TMP("ADEPEND",ADEU) S ADEU=ADEU+1 G ADEU1
 S ^TMP("ADEPEND",ADEU)="RUNNING"
 ; ^TMP is a transient, non-fileman working global.
 Q ADEU
 ;
ASKDEV(ADERTN,ADEDESC) ;EP - DEVICE SELECTION
 ;ADERTN=TASKMAN PROCESSING ROUTINE ENTRY POINT
 ;ADEDESC=TASK DESCRIPTION
 ;RETURNS ADEIOP,ADEIOPAR
 K ADEIOP,IOP,ZTSK,ADEIOPAR
 W !!,"Enter 'Q' at the DEVICE prompt to queue this report to run in the background."
 S %ZIS="NQ"
 D ^%ZIS
 Q:POP
 S ADEIOP=ION_";"_IOM_";"_IOSL
 S ADEIOPAR=IOPAR
 Q:'$D(IO("Q"))
 D QUE
 ;FHL 9/9/98 I '$D(ZTSK) K IOP,ADEIOP,ADEIOPAR G ASKDEV
 I '$D(ZTQUEUED) K IOP,ADEIOP,ADEIOPAR G ASKDEV
 D HOME^%ZIS
 W !,"REPORT IS QUEUED!"
 Q
 ;
QUE ;
 N ADEJ
 S ZTRTN=ADERTN
 S ZTDESC=ADEDESC
 F ADEJ="ADEIOP","ADEDATE" S ZTSAVE(ADEJ)=""
 S ZTSAVE("ADEIOPAR")=""
 S ZTSAVE("ADEU")=""
 S ZTIO=""
 I $D(IO("HFSIO")) D
 . S ZTIO=ADEIOP
 D ^%ZTLOAD
 Q
 ;
KILL ;EP - KILLS
 K ADEADA,ADEAGE,ADECNT,ADECOD,ADED0,ADED1,ADED2,ADEDATE
 K ADEDFN,ADEDUZ,ADEEXT,ADEHDFN,ADEHDFNS,ADEHNAM,ADEHYG,ADEJ,ADEK,ADEL
 K ADELOC,ADENAM,ADEOP,ADEPC,ADEPROV,ADEREP,ADEROPT,ADESTP,ADETDFN
 K ADETNAM,ADEIOPAR,ADEDESC,ADERTN,ADEU,ADEZTSK
 K ADEHXC,ADEHXO
 K ADENOD
 Q