DENTP1 ;ISC2/SAW-OTHER DENTAL REPORTS ; 12/5/88 4:35 PM
;;1.2;DENTAL;**24**;JAN 26, 1989
;SITTING/VISITS REPORT
S U="^",Z5="",Z1=0 G:'$D(^DENT(225,0)) W F Z3=0:1:2 S Z1=$O(^(Z1)) Q:Z1'>0 S Z2=Z1
G:Z3=0 W I Z3>1 S DIC="^DENT(225,",DIC(0)="AEMNQ",DIC("A")="Select STATION.DIVISION: " D ^DIC Q:Y<0 K DIC("A")
S Z1=$S(Z3=1:Z2,1:+Y) G W:'$D(^DENT(225,Z1,0)) S DENTSTA=$P(^(0),U,1) G W:DENTSTA=""
D1 W !,"Enter the starting and ending dates for the Treatment Data entries that",!,"you want to include in this report.",!
S %DT("A")="STARTING DATE: ",%DT="AEPX" D ^%DT K %DT("A") G EXIT:Y<0 S DENTSD=Y-.0001 X ^DD("DD") S H1=Y
S %DT("A")="ENDING DATE: ",%DT="AEPX" D ^%DT K %DT("A") G EXIT:Y<0 S DENTED=Y+.24 X ^DD("DD") S H2=Y
I DENTED<DENTSD W *7,!!,"End Date before Start Date?" G D1
A W !,"Would you like to review released data only" S %=2 D YN^DICN D:%=0 Q1 G A:%=0,EXIT:%<0 S:%=1 D1=1
S %ZIS="MQ" K IO("Q") D ^%ZIS G EXIT:IO=""
I $D(IO("Q")) S ZTRTN="QUE^DENTP1",ZTSAVE("DENTSD")="",ZTSAVE("DENTED")="",ZTSAVE("DENTSTA")="",ZTSAVE("D1")="",ZTSAVE("H1")="",ZTSAVE("H2")="" D ^%ZTLOAD K ZTSK,ZTRTN,ZTSAVE G CLOSE
QUE U IO S (E,V(1),V(2),V(3),S(1),S(2),S(3),F)=0
F I=0:0 S DENTSD=$O(^DENT(221,"A1",DENTSTA,DENTSD)) Q:DENTSD>DENTED!(DENTSD="") S DENT="" F K=0:0 S DENT=$O(^DENT(221,"A1",DENTSTA,DENTSD,DENT)) Q:DENT="" D:$D(D1)&($D(^DENT(221,DENT,.1))) R D:'$D(D1)&($D(^DENT(221,DENT,0))) R
W @IOF,!,?20,"TOTAL SITTINGS/VISITS BY PATIENT CATEGORY" S H3="("_$S(H1=H2:"For "_H1,1:"From "_H1_" to "_H2)_")" W !,?(80-$L(H3)/2),H3
W !!,?15,"Inpatient",?28,"Outpatient",?42,"Class I-VI",?61,"Total"
W !!,"Visits",?12,$J(V(1),12),?26,$J(V(2),12),?40,$J(V(3),12),?54,$J((V(1)+V(2)+V(3)),12)
W !,"Sittings",?12,$J(S(1),12),?26,$J(S(2),12),?40,$J(S(3),12),?54,$J((S(1)+S(2)+S(3)),12)
W ! I E W !,"NOTE: There ",$S(E=1:"is ",1:"are "),E," treatment data ",$S(E=1:"entry",1:"entries")," in the time frame you specified",!,"for which the Patient Category field was blank.",!
W:F>0 !,?15,"(Note: Sittings figure includes "_F_" admin procedure"_$S(F>1:"s.)",1:".)")
G CLOSE
R S Z=^DENT(221,DENT,0),X=$P(Z,"^",19),X1=$P(Z,"^",2) S:$P(Z,"^",8) F=F+1 S X=$S(X>0&(X<9):1,X>17&(X<23):2,X>8&(X<18):3,1:"")
I X="" S E=E+1 Q
I X1'="",'$P(Z,"^",8),'$D(^UTILITY($J,"DENT",DENTSD,X1)) S V(X)=V(X)+1,^UTILITY($J,"DENT",DENTSD,X1)=""
S S(X)=S(X)+1 Q
W W !!,"Stations have not been entered in the Dental Site Parameter file.",!,"You must enter a station before you can use this option" Q
TOS ;TYPE OF SERVICE REPORT
S DIC="^DIC(220.3,",FLDS=".001,.01,1,2",BY=.001,FR=1,TO=99,DHD="DENTAL TYPE OF SERVICE REPORT" D EN1^DIP
CLOSE X ^%ZIS("C")
EXIT K %DT,%ZIS,BY,DENT,DENTED,DENTSD,DENTSTA,DHD,D1,E,F,FLDS,FR,H1,H2,H3,HD1,I,S,TO,V,X,X1,Y,Z,Z1,Z2,Z5,^UTILITY($J,"DENT") K:$D(ZTSK) ^%ZTSK(ZTSK),ZTSK Q
Q1 W !!!,"Enter 'Y' or 'YES' if you want released data only. Press RETURN or enter 'N'",!,"or 'NO' if you do not want released data. Enter an uparrow (^) to EXIT.",! Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDENTP1 2991 printed Oct 16, 2024@17:47:31 Page 2
DENTP1 ;ISC2/SAW-OTHER DENTAL REPORTS ; 12/5/88 4:35 PM
+1 ;;1.2;DENTAL;**24**;JAN 26, 1989
+2 ;SITTING/VISITS REPORT
+3 SET U="^"
SET Z5=""
SET Z1=0
if '$DATA(^DENT(225,0))
GOTO W
FOR Z3=0:1:2
SET Z1=$ORDER(^(Z1))
if Z1'>0
QUIT
SET Z2=Z1
+4 if Z3=0
GOTO W
IF Z3>1
SET DIC="^DENT(225,"
SET DIC(0)="AEMNQ"
SET DIC("A")="Select STATION.DIVISION: "
DO ^DIC
if Y<0
QUIT
KILL DIC("A")
+5 SET Z1=$SELECT(Z3=1:Z2,1:+Y)
if '$DATA(^DENT(225,Z1,0))
GOTO W
SET DENTSTA=$PIECE(^(0),U,1)
if DENTSTA=""
GOTO W
D1 WRITE !,"Enter the starting and ending dates for the Treatment Data entries that",!,"you want to include in this report.",!
+1 SET %DT("A")="STARTING DATE: "
SET %DT="AEPX"
DO ^%DT
KILL %DT("A")
if Y<0
GOTO EXIT
SET DENTSD=Y-.0001
XECUTE ^DD("DD")
SET H1=Y
+2 SET %DT("A")="ENDING DATE: "
SET %DT="AEPX"
DO ^%DT
KILL %DT("A")
if Y<0
GOTO EXIT
SET DENTED=Y+.24
XECUTE ^DD("DD")
SET H2=Y
+3 IF DENTED<DENTSD
WRITE *7,!!,"End Date before Start Date?"
GOTO D1
A WRITE !,"Would you like to review released data only"
SET %=2
DO YN^DICN
if %=0
DO Q1
if %=0
GOTO A
if %<0
GOTO EXIT
if %=1
SET D1=1
+1 SET %ZIS="MQ"
KILL IO("Q")
DO ^%ZIS
if IO=""
GOTO EXIT
+2 IF $DATA(IO("Q"))
SET ZTRTN="QUE^DENTP1"
SET ZTSAVE("DENTSD")=""
SET ZTSAVE("DENTED")=""
SET ZTSAVE("DENTSTA")=""
SET ZTSAVE("D1")=""
SET ZTSAVE("H1")=""
SET ZTSAVE("H2")=""
DO ^%ZTLOAD
KILL ZTSK,ZTRTN,ZTSAVE
GOTO CLOSE
QUE USE IO
SET (E,V(1),V(2),V(3),S(1),S(2),S(3),F)=0
+1 FOR I=0:0
SET DENTSD=$ORDER(^DENT(221,"A1",DENTSTA,DENTSD))
if DENTSD>DENTED!(DENTSD="")
QUIT
SET DENT=""
FOR K=0:0
SET DENT=$ORDER(^DENT(221,"A1",DENTSTA,DENTSD,DENT))
if DENT=""
QUIT
if $DATA(D1)&($DATA(^DENT(221,DENT,.1)))
DO R
if '$DATA(D1)&($DATA(^DENT(221,DENT,0)))
DO R
+2 WRITE @IOF,!,?20,"TOTAL SITTINGS/VISITS BY PATIENT CATEGORY"
SET H3="("_$SELECT(H1=H2:"For "_H1,1:"From "_H1_" to "_H2)_")"
WRITE !,?(80-$LENGTH(H3)/2),H3
+3 WRITE !!,?15,"Inpatient",?28,"Outpatient",?42,"Class I-VI",?61,"Total"
+4 WRITE !!,"Visits",?12,$JUSTIFY(V(1),12),?26,$JUSTIFY(V(2),12),?40,$JUSTIFY(V(3),12),?54,$JUSTIFY((V(1)+V(2)+V(3)),12)
+5 WRITE !,"Sittings",?12,$JUSTIFY(S(1),12),?26,$JUSTIFY(S(2),12),?40,$JUSTIFY(S(3),12),?54,$JUSTIFY((S(1)+S(2)+S(3)),12)
+6 WRITE !
IF E
WRITE !,"NOTE: There ",$SELECT(E=1:"is ",1:"are "),E," treatment data ",$SELECT(E=1:"entry",1:"entries")," in the time frame you specified",!,"for which the Patient Category field was blank.",!
+7 if F>0
WRITE !,?15,"(Note: Sittings figure includes "_F_" admin procedure"_$SELECT(F>1:"s.)",1:".)")
+8 GOTO CLOSE
R SET Z=^DENT(221,DENT,0)
SET X=$PIECE(Z,"^",19)
SET X1=$PIECE(Z,"^",2)
if $PIECE(Z,"^",8)
SET F=F+1
SET X=$SELECT(X>0&(X<9):1,X>17&(X<23):2,X>8&(X<18):3,1:"")
+1 IF X=""
SET E=E+1
QUIT
+2 IF X1'=""
IF '$PIECE(Z,"^",8)
IF '$DATA(^UTILITY($JOB,"DENT",DENTSD,X1))
SET V(X)=V(X)+1
SET ^UTILITY($JOB,"DENT",DENTSD,X1)=""
+3 SET S(X)=S(X)+1
QUIT
W WRITE !!,"Stations have not been entered in the Dental Site Parameter file.",!,"You must enter a station before you can use this option"
QUIT
TOS ;TYPE OF SERVICE REPORT
+1 SET DIC="^DIC(220.3,"
SET FLDS=".001,.01,1,2"
SET BY=.001
SET FR=1
SET TO=99
SET DHD="DENTAL TYPE OF SERVICE REPORT"
DO EN1^DIP
CLOSE XECUTE ^%ZIS("C")
EXIT KILL %DT,%ZIS,BY,DENT,DENTED,DENTSD,DENTSTA,DHD,D1,E,F,FLDS,FR,H1,H2,H3,HD1,I,S,TO,V,X,X1,Y,Z,Z1,Z2,Z5,^UTILITY($JOB,"DENT")
if $DATA(ZTSK)
KILL ^%ZTSK(ZTSK),ZTSK
QUIT
Q1 WRITE !!!,"Enter 'Y' or 'YES' if you want released data only. Press RETURN or enter 'N'",!,"or 'NO' if you do not want released data. Enter an uparrow (^) to EXIT.",!
QUIT