DENTA1 ;ISC2/SAW,HAG-DENTAL TREATMENT DATA SERVICE REPORTS ; 1/10/89 11:08 AM ;
;;1.2;DENTAL;**24**;JAN 26, 1989
D:'$D(DT) DT^DICRW S %O="OPT",U="^",S=";",O=$T(@(%O)),DENTV=$$VERSION^XPDUTL("DENT") I $D(^DOPT($P(O,S,5),"VERSION")),(DENTV=^DOPT($P(O,S,5),"VERSION")) G IN
K ^DOPT($P(O,S,5))
F I=1:1 Q:$T(@(%O)+I)="" S ^DOPT($P(O,S,5),I,0)=$P($T(@(%O)+I),S,3),^DOPT($P(O,S,5),"B",$P($P($T(@(%O)+I),S,3),"^",1),I)=""
S K=I-1,^DOPT($P(O,S,5),0)=$P(O,S,4)_U_1_U_K_U_K K I,K,X S ^DOPT($P(O,S,5),"VERSION")=DENTV
IN I $P(O,S,6)'="" D @($P(O,S,6))
PR S O=$T(@(%O)),S=";" S IOP=$I D ^%ZIS W:IOST'["PK-" @IOF K IOP
I $P(O,S,7)'="" D @($P(O,S,7))
E W !!,$P(O,S,3),":",!,$$VERSION^XPDUTL("DENT")," ",$P($T(+1),S,1),!!,$P(O,S,4),"S:",!
F J=1:1 Q:'$D(^DOPT($P(O,S,5),J,0)) S K=$S(J<10:15,1:14) W !,?K,J,". ",$P(^DOPT($P(O,S,5),J,0),U,1)
RE W ! S DIC("A")="Select "_$P($T(OPT),S,4)_": EXIT// ",DIC="^DOPT("_""""_$P($T(OPT),S,5)_""""_",",DIC(0)="AEQMN" D ^DIC G:X=""!(X=U) EXIT G:Y<0 RE K DIC,J,O D @($P($T(OPT+Y),S,4)) G PR
PROV D DATE G EXIT:Y<0 D ^DENTA11,CLOSE G PROV
SITPROV D DATE G EXIT:Y<0 D ^DENTA12,CLOSE G SITPROV
CLINIC D DATE G EXIT:Y<0 D ^DENTA13,CLOSE G CLINIC
SIT D DATE G EXIT:Y<0 D ^DENTA14,CLOSE G SIT
DATE W !! K ^UTILITY($J,"DENTERR"),^UTILITY($J,"DENTR"),^UTILITY($J,"DENTDUP") 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: " S:$D(DENTSTA) DIC("B")=$S(DENTSTA[" ":+DENTSTA,1:DENTSTA) D ^DIC Q:Y<0 K DIC("A"),DIC("B")
S Z1=$S(Z3=1:Z2,1:+Y) S DENTSTA=$P(^DENT(225,Z1,0),U,1) I DENTSTA="" D W S Y=-1 Q
D1 W !!,"Enter the starting and ending dates for the data entries that",!,"you wish to include in this report.",!
S %DT("A")="STARTING DATE: ",%DT="AEPX" D ^%DT K %DT("A") Q:Y<0 S (DENTSD1,DENTSD)=Y X ^DD("DD") S H1=Y
S %DT("A")="ENDING DATE: ",%DT="AEPX" D ^%DT K %DT("A") Q:Y<0 S DENTED=Y+.24 X ^DD("DD") S H2=Y
I DENTED<DENTSD W *7,!!,"End Date before Start Date?" G D1
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
CLOSE X ^%ZIS("C")
EXIT K %,%DT,DENTC,DENTED,DENTF,DENTF1,DENTSD,DENTSD1,DENTV,DIC,H1,H2,H5,I,J,K,O,Q,Q1,S,X,X1,Y,Z1,Z2,Z5
EXIT1 K ^UTILITY($J,"DENTERR"),^UTILITY($J,"DENTR"),^UTILITY($J,"DENTV"),^UTILITY($J,"DENTP") K:$D(ZTSK) ^%ZTSK(ZTSK),ZTSK Q
OPT ;;TREATMENT DATA SERVICE REPORTS;OPTION;DENTA1
;;PROVIDER SUMMARY;PROV
;;SITTINGS BY PROVIDER;SITPROV
;;CLINIC SUMMARY;CLINIC
;;INDIVIDUAL SITTINGS;SIT
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDENTA1 2602 printed Oct 16, 2024@17:46:32 Page 2
DENTA1 ;ISC2/SAW,HAG-DENTAL TREATMENT DATA SERVICE REPORTS ; 1/10/89 11:08 AM ;
+1 ;;1.2;DENTAL;**24**;JAN 26, 1989
+2 if '$DATA(DT)
DO DT^DICRW
SET %O="OPT"
SET U="^"
SET S=";"
SET O=$TEXT(@(%O))
SET DENTV=$$VERSION^XPDUTL("DENT")
IF $DATA(^DOPT($PIECE(O,S,5),"VERSION"))
IF (DENTV=^DOPT($PIECE(O,S,5),"VERSION"))
GOTO IN
+3 KILL ^DOPT($PIECE(O,S,5))
+4 FOR I=1:1
if $TEXT(@(%O)+I)=""
QUIT
SET ^DOPT($PIECE(O,S,5),I,0)=$PIECE($TEXT(@(%O)+I),S,3)
SET ^DOPT($PIECE(O,S,5),"B",$PIECE($PIECE($TEXT(@(%O)+I),S,3),"^",1),I)=""
+5 SET K=I-1
SET ^DOPT($PIECE(O,S,5),0)=$PIECE(O,S,4)_U_1_U_K_U_K
KILL I,K,X
SET ^DOPT($PIECE(O,S,5),"VERSION")=DENTV
IN IF $PIECE(O,S,6)'=""
DO @($PIECE(O,S,6))
PR SET O=$TEXT(@(%O))
SET S=";"
SET IOP=$IO
DO ^%ZIS
if IOST'["PK-"
WRITE @IOF
KILL IOP
+1 IF $PIECE(O,S,7)'=""
DO @($PIECE(O,S,7))
+2 IF '$TEST
WRITE !!,$PIECE(O,S,3),":",!,$$VERSION^XPDUTL("DENT")," ",$PIECE($TEXT(+1),S,1),!!,$PIECE(O,S,4),"S:",!
+3 FOR J=1:1
if '$DATA(^DOPT($PIECE(O,S,5),J,0))
QUIT
SET K=$SELECT(J<10:15,1:14)
WRITE !,?K,J,". ",$PIECE(^DOPT($PIECE(O,S,5),J,0),U,1)
RE WRITE !
SET DIC("A")="Select "_$PIECE($TEXT(OPT),S,4)_": EXIT// "
SET DIC="^DOPT("_""""_$PIECE($TEXT(OPT),S,5)_""""_","
SET DIC(0)="AEQMN"
DO ^DIC
if X=""!(X=U)
GOTO EXIT
if Y<0
GOTO RE
KILL DIC,J,O
DO @($PIECE($TEXT(OPT+Y),S,4))
GOTO PR
PROV DO DATE
if Y<0
GOTO EXIT
DO ^DENTA11
DO CLOSE
GOTO PROV
SITPROV DO DATE
if Y<0
GOTO EXIT
DO ^DENTA12
DO CLOSE
GOTO SITPROV
CLINIC DO DATE
if Y<0
GOTO EXIT
DO ^DENTA13
DO CLOSE
GOTO CLINIC
SIT DO DATE
if Y<0
GOTO EXIT
DO ^DENTA14
DO CLOSE
GOTO SIT
DATE WRITE !!
KILL ^UTILITY($JOB,"DENTERR"),^UTILITY($JOB,"DENTR"),^UTILITY($JOB,"DENTDUP")
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
+1 if Z3=0
GOTO W
IF Z3>1
SET DIC="^DENT(225,"
SET DIC(0)="AEMNQ"
SET DIC("A")="Select STATION.DIVISION: "
if $DATA(DENTSTA)
SET DIC("B")=$SELECT(DENTSTA[" ":+DENTSTA,1:DENTSTA)
DO ^DIC
if Y<0
QUIT
KILL DIC("A"),DIC("B")
+2 SET Z1=$SELECT(Z3=1:Z2,1:+Y)
SET DENTSTA=$PIECE(^DENT(225,Z1,0),U,1)
IF DENTSTA=""
DO W
SET Y=-1
QUIT
D1 WRITE !!,"Enter the starting and ending dates for the data entries that",!,"you wish to include in this report.",!
+1 SET %DT("A")="STARTING DATE: "
SET %DT="AEPX"
DO ^%DT
KILL %DT("A")
if Y<0
QUIT
SET (DENTSD1,DENTSD)=Y
XECUTE ^DD("DD")
SET H1=Y
+2 SET %DT("A")="ENDING DATE: "
SET %DT="AEPX"
DO ^%DT
KILL %DT("A")
if Y<0
QUIT
SET DENTED=Y+.24
XECUTE ^DD("DD")
SET H2=Y
+3 IF DENTED<DENTSD
WRITE *7,!!,"End Date before Start Date?"
GOTO D1
+4 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
CLOSE XECUTE ^%ZIS("C")
EXIT KILL %,%DT,DENTC,DENTED,DENTF,DENTF1,DENTSD,DENTSD1,DENTV,DIC,H1,H2,H5,I,J,K,O,Q,Q1,S,X,X1,Y,Z1,Z2,Z5
EXIT1 KILL ^UTILITY($JOB,"DENTERR"),^UTILITY($JOB,"DENTR"),^UTILITY($JOB,"DENTV"),^UTILITY($JOB,"DENTP")
if $DATA(ZTSK)
KILL ^%ZTSK(ZTSK),ZTSK
QUIT
OPT ;;TREATMENT DATA SERVICE REPORTS;OPTION;DENTA1
+1 ;;PROVIDER SUMMARY;PROV
+2 ;;SITTINGS BY PROVIDER;SITPROV
+3 ;;CLINIC SUMMARY;CLINIC
+4 ;;INDIVIDUAL SITTINGS;SIT