BADEPRV1 ;IHS/SAIC/FJE MSC/AMF - Dentrix Dental Visit Count ;14-Sep-2010 13:59;EDR
;;1.0;DENTAL/EDR INTERFACE;**1**;AUG 22, 2011
Q
FINDDLOC ;EP Display all Dental Location of Encounter ASUFACs in RPMS
;Optional Begin Date filter to limit data to current period of time
;If null, all Dental visits will be viewed
;This report displays all ASUFAC values and names associated with Dental Visits Only
;
N BADEIEN,BADEVSIT,BADEVDT,BADESTRT,BADEASUF,BADEXX,BADENAME,BADEACT,BADEDT
N X,%ZIS,IORVON,IORVOFF,VER,PKG,K
; Display statistics
I $E($G(IOST),1,2)'="C-" W !,"Your terminal Type is not defined correctly for this report.",!! S DIR(0)="EA",DIR("?")="",DIR("A")="Press ENTER to continue..." D ^DIR K DIR Q
S VER="Version "_$G(VER,1.0),PKG=$G(PKG,"RPMS-Dentrix Dental ASUFAC Display")
S X="IORVON;IORVOFF"
D ENDR^%ZISS
U IO
K %DT D NOW^%DTC S BADEDT=X
W !!,"This report will display visits for each Dental Facility for a specific time period.",!
S DIR(0)="D"_BADEDT_":EP",DIR("B")="T-365",DIR("A")="Enter the start date for the search"
S DIR("?")="Specify the earliest date for your search." D ^DIR K DIR
Q:Y=U S BADESTRT=+Y
;S BADESTRT=0 I +Y>0 S BADESTRT=+Y
W !,"Searching..." S K=0
K BADEXX
S BADEIEN=0 F S BADEIEN=$O(^AUPNVDEN(BADEIEN)) Q:+BADEIEN'>0 D
.S K=K+1 W:'(K#5000) "."
.Q:'$D(^AUPNVDEN(BADEIEN,0))
.S BADEVSIT=+$P($G(^AUPNVDEN(BADEIEN,0)),U,3) ; VisitIEN
.Q:'BADEVSIT
.S BADEVDT=+$P($G(^AUPNVSIT(BADEVSIT,0)),U,1) ; Visit Date/Time
.Q:BADEVDT<BADESTRT ;;Less Than Start Visit Date
.S BADEASUF=$S(+$P($G(^AUPNVSIT(BADEVSIT,0)),U,6):$P($G(^AUPNVSIT(BADEVSIT,0)),U,6),1:0) ;ASUFAC IEN
.I '$D(BADEXX(BADEASUF)) S BADEXX(BADEASUF)=0
.S BADEXX(BADEASUF)=BADEXX(BADEASUF)+1
;
W @IOF,IORVON,$$GET1^DIQ(4,DUZ(2),.01),?(IOM-$L(PKG)\2),PKG,?(IOM-$L(VER)),VER,!,IORVOFF
I '$D(BADEXX) W !,"No visits were found for this time period.",!! S DIR(0)="EA",DIR("?")="",DIR("A")="Press ENTER to continue..." D ^DIR K DIR Q
W !!,"Dental Facility",?32,"ASUFAC Status Dental Visit Count"
W !,"----------------------------------------------------------------------"
S BADEIEN="" F S BADEIEN=$O(BADEXX(BADEIEN)) Q:+BADEIEN=0 D
.S BADENAME=$S($L($P($G(^DIC(4,BADEIEN,0)),U,1)):$P($G(^DIC(4,BADEIEN,0)),U,1),1:"No Name")
.S BADEASUF=$S(+$P($G(^AUTTLOC(BADEIEN,0)),"^",10):$P($G(^AUTTLOC(BADEIEN,0)),"^",10),1:"None")
.S BADEACT=$S(+$P($G(^AUTTLOC(BADEIEN,0)),"^",21):"Inactive",1:"Active")
.W !,BADENAME,?32,BADEASUF,?43,BADEACT,?50,BADEXX(BADEIEN)
W !!
S DIR(0)="EA",DIR("?")="",DIR("A")="Press ENTER to continue..." D ^DIR K DIR
Q
;
FINDVLOC ;EP Display all Location of Encounter ASUFACs in RPMS
;Optional Begin Date filter to limit data to current period of time
;If null, all Dental visits will be viewed
;This report displays all ASUFAC values and names associated with All Visits
;
N BADEIEN,BADEVSIT,BADEVDT,BADESTRT,BADEASUF,BADEXX,BADENAME,BADEACT
N X,%ZIS,IORVON,IORVOFF,VER,PKG
; Display statistics
Q:$E($G(IOST),1,2)'="C-"
S VER="Version "_$G(VER,1.0),PKG=$G(PKG,"RPMS-Dentrix Visit LOE ASUFAC Display")
S X="IORVON;IORVOFF"
D ENDR^%ZISS
U IO
K %DT D NOW^%DTC S BADEDT=X
S DIR(0)="D^:"_BADEDT_":EP",DIR("A")="Enter Start Date of Scan: " KILL DA D ^DIR KILL DIR
S BADESTRT=0 I +Y>0 S BADESTRT=+Y
S DIR(0)="E",DIR("A")="Press Enter to Continue" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
Q:$G(DIRUT)=1
W !,"Thinking...",!
K BADEXX
S BADEIEN=0 F S BADEIEN=$O(^AUPNVSIT(BADEIEN)) Q:+BADEIEN'>0 D
.Q:'$D(^AUPNVSIT(BADEIEN,0))
.S BADEVDT=+$P($G(^AUPNVSIT(BADEIEN,0)),U,1) ;Visit Date/Time
.Q:BADEVDT<BADESTRT ;;Less Than Start Visit Date
.S BADEASUF=$S(+$P($G(^AUPNVSIT(BADEIEN,0)),U,6):$P($G(^AUPNVSIT(BADEIEN,0)),U,6),1:0) ;ASUFAC IEN
.I '$D(BADEXX(BADEASUF)) S BADEXX(BADEASUF)=0
.S BADEXX(BADEASUF)=BADEXX(BADEASUF)+1
;
W @IOF,IORVON,$$GET1^DIQ(4,DUZ(2),.01),?(IOM-$L(PKG)\2),PKG,?(IOM-$L(VER)),VER,!,IORVOFF
W !!,"Visit LOC Name",?32,"ASUFAC Status Visit Count"
W !,"----------------------------------------------------------------------"
S BADEIEN=0 F S BADEIEN=$O(BADEXX(BADEIEN)) Q:+BADEIEN=0 D
.S BADENAME=$S($L($P($G(^DIC(4,BADEIEN,0)),U,1)):$P($G(^DIC(4,BADEIEN,0)),U,1),1:"No Name")
.S BADEASUF=$S(+$P($G(^AUTTLOC(BADEIEN,0)),"^",10):$P($G(^AUTTLOC(BADEIEN,0)),"^",10),1:"None")
.S BADEACT=$S(+$P($G(^AUTTLOC(BADEIEN,0)),"^",21):"Inact",1:"Act")
.W !,BADENAME,?32,BADEASUF,?43,BADEACT,?50,BADEXX(BADEIEN)
W !!
S DIR(0)="EA",DIR("?")="",DIR("A")="Press ENTER to continue..." D ^DIR K DIR
Q
;
BADEPRV1 ;IHS/SAIC/FJE MSC/AMF - Dentrix Dental Visit Count ;14-Sep-2010 13:59;EDR
+1 ;;1.0;DENTAL/EDR INTERFACE;**1**;AUG 22, 2011
+2 QUIT
FINDDLOC ;EP Display all Dental Location of Encounter ASUFACs in RPMS
+1 ;Optional Begin Date filter to limit data to current period of time
+2 ;If null, all Dental visits will be viewed
+3 ;This report displays all ASUFAC values and names associated with Dental Visits Only
+4 ;
+5 NEW BADEIEN,BADEVSIT,BADEVDT,BADESTRT,BADEASUF,BADEXX,BADENAME,BADEACT,BADEDT
+6 NEW X,%ZIS,IORVON,IORVOFF,VER,PKG,K
+7 ; Display statistics
+8 IF $EXTRACT($GET(IOST),1,2)'="C-"
WRITE !,"Your terminal Type is not defined correctly for this report.",!!
SET DIR(0)="EA"
SET DIR("?")=""
SET DIR("A")="Press ENTER to continue..."
DO ^DIR
KILL DIR
QUIT
+9 SET VER="Version "_$GET(VER,1.0)
SET PKG=$GET(PKG,"RPMS-Dentrix Dental ASUFAC Display")
+10 SET X="IORVON;IORVOFF"
+11 DO ENDR^%ZISS
+12 USE IO
+13 KILL %DT
DO NOW^%DTC
SET BADEDT=X
+14 WRITE !!,"This report will display visits for each Dental Facility for a specific time period.",!
+15 SET DIR(0)="D"_BADEDT_":EP"
SET DIR("B")="T-365"
SET DIR("A")="Enter the start date for the search"
+16 SET DIR("?")="Specify the earliest date for your search."
DO ^DIR
KILL DIR
+17 IF Y=U
QUIT
SET BADESTRT=+Y
+18 ;S BADESTRT=0 I +Y>0 S BADESTRT=+Y
+19 WRITE !,"Searching..."
SET K=0
+20 KILL BADEXX
+21 SET BADEIEN=0
FOR
SET BADEIEN=$ORDER(^AUPNVDEN(BADEIEN))
IF +BADEIEN'>0
QUIT
Begin DoDot:1
+22 SET K=K+1
IF '(K#5000)
WRITE "."
+23 IF '$DATA(^AUPNVDEN(BADEIEN,0))
QUIT
+24 ; VisitIEN
SET BADEVSIT=+$PIECE($GET(^AUPNVDEN(BADEIEN,0)),U,3)
+25 IF 'BADEVSIT
QUIT
+26 ; Visit Date/Time
SET BADEVDT=+$PIECE($GET(^AUPNVSIT(BADEVSIT,0)),U,1)
+27 ;;Less Than Start Visit Date
IF BADEVDT<BADESTRT
QUIT
+28 ;ASUFAC IEN
SET BADEASUF=$SELECT(+$PIECE($GET(^AUPNVSIT(BADEVSIT,0)),U,6):$PIECE($GET(^AUPNVSIT(BADEVSIT,0)),U,6),1:0)
+29 IF '$DATA(BADEXX(BADEASUF))
SET BADEXX(BADEASUF)=0
+30 SET BADEXX(BADEASUF)=BADEXX(BADEASUF)+1
End DoDot:1
+31 ;
+32 WRITE @IOF,IORVON,$$GET1^DIQ(4,DUZ(2),.01),?(IOM-$LENGTH(PKG)\2),PKG,?(IOM-$LENGTH(VER)),VER,!,IORVOFF
+33 IF '$DATA(BADEXX)
WRITE !,"No visits were found for this time period.",!!
SET DIR(0)="EA"
SET DIR("?")=""
SET DIR("A")="Press ENTER to continue..."
DO ^DIR
KILL DIR
QUIT
+34 WRITE !!,"Dental Facility",?32,"ASUFAC Status Dental Visit Count"
+35 WRITE !,"----------------------------------------------------------------------"
+36 SET BADEIEN=""
FOR
SET BADEIEN=$ORDER(BADEXX(BADEIEN))
IF +BADEIEN=0
QUIT
Begin DoDot:1
+37 SET BADENAME=$SELECT($LENGTH($PIECE($GET(^DIC(4,BADEIEN,0)),U,1)):$PIECE($GET(^DIC(4,BADEIEN,0)),U,1),1:"No Name")
+38 SET BADEASUF=$SELECT(+$PIECE($GET(^AUTTLOC(BADEIEN,0)),"^",10):$PIECE($GET(^AUTTLOC(BADEIEN,0)),"^",10),1:"None")
+39 SET BADEACT=$SELECT(+$PIECE($GET(^AUTTLOC(BADEIEN,0)),"^",21):"Inactive",1:"Active")
+40 WRITE !,BADENAME,?32,BADEASUF,?43,BADEACT,?50,BADEXX(BADEIEN)
End DoDot:1
+41 WRITE !!
+42 SET DIR(0)="EA"
SET DIR("?")=""
SET DIR("A")="Press ENTER to continue..."
DO ^DIR
KILL DIR
+43 QUIT
+44 ;
FINDVLOC ;EP Display all Location of Encounter ASUFACs in RPMS
+1 ;Optional Begin Date filter to limit data to current period of time
+2 ;If null, all Dental visits will be viewed
+3 ;This report displays all ASUFAC values and names associated with All Visits
+4 ;
+5 NEW BADEIEN,BADEVSIT,BADEVDT,BADESTRT,BADEASUF,BADEXX,BADENAME,BADEACT
+6 NEW X,%ZIS,IORVON,IORVOFF,VER,PKG
+7 ; Display statistics
+8 IF $EXTRACT($GET(IOST),1,2)'="C-"
QUIT
+9 SET VER="Version "_$GET(VER,1.0)
SET PKG=$GET(PKG,"RPMS-Dentrix Visit LOE ASUFAC Display")
+10 SET X="IORVON;IORVOFF"
+11 DO ENDR^%ZISS
+12 USE IO
+13 KILL %DT
DO NOW^%DTC
SET BADEDT=X
+14 SET DIR(0)="D^:"_BADEDT_":EP"
SET DIR("A")="Enter Start Date of Scan: "
KILL DA
DO ^DIR
KILL DIR
+15 SET BADESTRT=0
IF +Y>0
SET BADESTRT=+Y
+16 SET DIR(0)="E"
SET DIR("A")="Press Enter to Continue"
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+17 IF $GET(DIRUT)=1
QUIT
+18 WRITE !,"Thinking...",!
+19 KILL BADEXX
+20 SET BADEIEN=0
FOR
SET BADEIEN=$ORDER(^AUPNVSIT(BADEIEN))
IF +BADEIEN'>0
QUIT
Begin DoDot:1
+21 IF '$DATA(^AUPNVSIT(BADEIEN,0))
QUIT
+22 ;Visit Date/Time
SET BADEVDT=+$PIECE($GET(^AUPNVSIT(BADEIEN,0)),U,1)
+23 ;;Less Than Start Visit Date
IF BADEVDT<BADESTRT
QUIT
+24 ;ASUFAC IEN
SET BADEASUF=$SELECT(+$PIECE($GET(^AUPNVSIT(BADEIEN,0)),U,6):$PIECE($GET(^AUPNVSIT(BADEIEN,0)),U,6),1:0)
+25 IF '$DATA(BADEXX(BADEASUF))
SET BADEXX(BADEASUF)=0
+26 SET BADEXX(BADEASUF)=BADEXX(BADEASUF)+1
End DoDot:1
+27 ;
+28 WRITE @IOF,IORVON,$$GET1^DIQ(4,DUZ(2),.01),?(IOM-$LENGTH(PKG)\2),PKG,?(IOM-$LENGTH(VER)),VER,!,IORVOFF
+29 WRITE !!,"Visit LOC Name",?32,"ASUFAC Status Visit Count"
+30 WRITE !,"----------------------------------------------------------------------"
+31 SET BADEIEN=0
FOR
SET BADEIEN=$ORDER(BADEXX(BADEIEN))
IF +BADEIEN=0
QUIT
Begin DoDot:1
+32 SET BADENAME=$SELECT($LENGTH($PIECE($GET(^DIC(4,BADEIEN,0)),U,1)):$PIECE($GET(^DIC(4,BADEIEN,0)),U,1),1:"No Name")
+33 SET BADEASUF=$SELECT(+$PIECE($GET(^AUTTLOC(BADEIEN,0)),"^",10):$PIECE($GET(^AUTTLOC(BADEIEN,0)),"^",10),1:"None")
+34 SET BADEACT=$SELECT(+$PIECE($GET(^AUTTLOC(BADEIEN,0)),"^",21):"Inact",1:"Act")
+35 WRITE !,BADENAME,?32,BADEASUF,?43,BADEACT,?50,BADEXX(BADEIEN)
End DoDot:1
+36 WRITE !!
+37 SET DIR(0)="EA"
SET DIR("?")=""
SET DIR("A")="Press ENTER to continue..."
DO ^DIR
KILL DIR
+38 QUIT
+39 ;