DENTAR15 ;ISC2/SAW,HAG-PRINT/DISPLAY TREATMENT DATA REPORTS FOR REVIEW/RELEASE ; 7/21/88 5:36 PM ;
;VERSION 1.2
I 'DENTC G NONE
S DENTPRV="" F M=0:0 S DENTPRV=$O(^UTILITY($J,"DENTR",DENTPRV)) Q:DENTPRV="" D RPT Q:Z5=U
G EXIT
RPT S H="SUMMARY REPORT BY PROVIDER",H4="INPATIENT AND OUTPATIENT",H6="DENTAL PROVIDER NO.: "_DENTPRV D HDR,HDR1
F I=2:1:6,8:1:39 D:$Y#(IOSL-2)=0 HOLD1 Q:Z5=U W !,$E($P(^DIC(220.3,I,0),U,1),1,20),?21 F J=1:1:8,18:1:22 S K=$S(J<18:3,1:4) W ?($X+1),$J($S($D(^UTILITY($J,"DENTR",DENTPRV,I,J)):^(J),1:"."),K)
Q:Z5=U S H4="STAFF TREATED" D HOLD2 Q:Z5=U F I=2:1:6,8:1:39 D:$Y#(IOSL-2)=0 HOLD2 Q:Z5=U W !,$E($P(^DIC(220.3,I,0),U,1),1,20),?22 F J=9:1:17 W ?($X+1),$J($S($D(^UTILITY($J,"DENTR",DENTPRV,I,J)):^(J),1:"."),5)
Q:Z5=U D HOLD Q
A S H="SUMMARY REPORT FOR CLINIC",H4="INPATIENT AND OUTPATIENT",H6="" D HDR,HDR1,A1 G EXIT
A1 F I=2:1:6,8:1:39 D:$Y#(IOSL-2)=0 HOLD1 Q:Z5=U W !,$E($P(^DIC(220.3,I,0),U,1),1,20),?21 F J=1:1:8,18:1:22 S K=$S(J<18:3,1:4) W ?($X+1),$J($S($D(^UTILITY($J,"DENTR",I,J)):^(J),1:"."),K)
Q:Z5=U S H4="STAFF TREATED" D HOLD2 Q:Z5=U F I=2:1:6,8:1:39 D:$Y#(IOSL-2)=0 HOLD2 Q:Z5=U W !,$E($P(^DIC(220.3,I,0),U,1),1,20),?22 F J=9:1:17 W ?($X+1),$J($S($D(^UTILITY($J,"DENTR",I,J)):^(J),1:"."),5)
Q:Z5=U D HOLD Q
HDR S H3="DENTAL SERVICE TREATMENT REPORT - "_H,H5=$S(H1=H2:"FOR "_H1,1:"FROM "_H1_" TO "_H2)_" STATION NO.: "_Z3_$S(H6="":"",1:" ")_H6,H7=H4_" DENTAL CATEGORY/CLASS"
W @IOF,?(80-$L(H3)\2),H3,!,?(80-$L(H5)\2),H5
W !!,?(100-$L(H7)\2),H7 Q
HDR1 W !,"PROCEDURE",?21 F K=1:1:8,18:1:22 W ?($X+3),K
Q
HDR2 W !,"PROCEDURE",?27,"I",?32,"II",?38,"IIA",?44,"IIB",?50,"IIC",?56,"III",?62,"IV",?69,"V",?74,"VI" Q
HOLD1 D HOLD D:Z5'=U HDR,HDR1 Q
HOLD2 D HOLD D:Z5'=U HDR,HDR2 Q
HOLD Q:$D(ZTSK)!(IO'=IO(0)) S Z5="" R !,"Press return to continue, uparrow (^) to exit: ",Z5:DTIME Q
NONE S DENTF1=1 W !,"There is no treatment data for review/release for the time frame you specified" W:'$D(ZTSK)&IO=IO(0) *7 G EXIT1
COMP W !,"There "_$S(DENTC(1)+DENTC=1:"is ",1:"are ")_(DENTC(1)+DENTC)_$S(DENTC(1)+DENTC=1:" sitting",1:" sittings")_" in the time frame you specified. All data is complete" Q
ERR W !!,"The treatment data for this report is incomplete/incorrect.",!,"There are ",(DENTC(1)+DENTC)," sittings in the time frame you specified.",!,"The following errors were found:" W:'$D(ZTSK)&IO=IO(0) *7,! Q
CHK K Z S DENTF=0 I $P(X,U,10)="" S Z(1)="PROVIDER NUMBER IS MISSING",DENTF=1
I $P(X,U,2)="" S Z(2)="PATIENT SSN IS MISSING",DENTF=1
I $P(X,U,19)="" S Z(3)="PATIENT CATEGORY/CLASS IS MISSING",DENTF=1 G CHK1
I $P(X,U,6)="",$P(X,U,19)<9,$P(X,U,19)'=4,$P(X,U,19)'=5 S Z(4)="BED SECTION IS MISSING",DENTF=1
I $P(X,U,6)'="" I $P(X,U,19)>8!($P(X,U,19)=4)!($P(X,U,19)=5) S Z(5)="BED SECTION ENTERED FOR NON INPATIENT PATIENT CATEGORY",DENTF=1
CHK1 I DENTF S Z="",DENTF1=1,Y=$P(X,U,1) X ^DD("DD") F L=0:0 S Z=$O(Z(Z)) Q:Z="" S ^UTILITY($J,"DENTERR",(DENTC(1)+DENTC),Z)="**ERROR** TREATMENT DATE "_Y_" "_Z(Z)
Q
EXIT G EXIT1:Z5=U I $D(DENTF1) W @IOF,*7 D ERR S H="" F I=1:1 Q:Z5=U S H=$O(^UTILITY($J,"DENTERR",H)) Q:H="" F J=1:1:5 D:$Y#(IOSL-2)=0 HOLD Q:Z5=U W:$D(^UTILITY($J,"DENTERR",H,J)) !,^(J)
D:'$D(DENTF1) COMP W ! D:$D(DENTF1)&(Z5'=U) HOLD
EXIT1 S:Z5=U DENTF1=1 K DENTPRV,H,H1,H2,H3,H4,H6,H7,I,J,K,L,M,X,Y,Z Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDENTAR15 3321 printed Dec 13, 2024@01:45:59 Page 2
DENTAR15 ;ISC2/SAW,HAG-PRINT/DISPLAY TREATMENT DATA REPORTS FOR REVIEW/RELEASE ; 7/21/88 5:36 PM ;
+1 ;VERSION 1.2
+2 IF 'DENTC
GOTO NONE
+3 SET DENTPRV=""
FOR M=0:0
SET DENTPRV=$ORDER(^UTILITY($JOB,"DENTR",DENTPRV))
if DENTPRV=""
QUIT
DO RPT
if Z5=U
QUIT
+4 GOTO EXIT
RPT SET H="SUMMARY REPORT BY PROVIDER"
SET H4="INPATIENT AND OUTPATIENT"
SET H6="DENTAL PROVIDER NO.: "_DENTPRV
DO HDR
DO HDR1
+1 FOR I=2:1:6,8:1:39
if $Y#(IOSL-2)=0
DO HOLD1
if Z5=U
QUIT
WRITE !,$EXTRACT($PIECE(^DIC(220.3,I,0),U,1),1,20),?21
FOR J=1:1:8,18:1:22
SET K=$SELECT(J<18:3,1:4)
WRITE ?($X+1),$JUSTIFY($SELECT($DATA(^UTILITY($JOB,"DENTR",DENTPRV,I,J)):^(J),1:"."),K)
+2 if Z5=U
QUIT
SET H4="STAFF TREATED"
DO HOLD2
if Z5=U
QUIT
FOR I=2:1:6,8:1:39
if $Y#(IOSL-2)=0
DO HOLD2
if Z5=U
QUIT
WRITE !,$EXTRACT($PIECE(^DIC(220.3,I,0),U,1),1,20),?22
FOR J=9:1:17
WRITE ?($X+1),$JUSTIFY($SELECT($DATA(^UTILITY($JOB,"DENTR",DENTPRV,I,J)):^(J),1:"."),5)
+3 if Z5=U
QUIT
DO HOLD
QUIT
A SET H="SUMMARY REPORT FOR CLINIC"
SET H4="INPATIENT AND OUTPATIENT"
SET H6=""
DO HDR
DO HDR1
DO A1
GOTO EXIT
A1 FOR I=2:1:6,8:1:39
if $Y#(IOSL-2)=0
DO HOLD1
if Z5=U
QUIT
WRITE !,$EXTRACT($PIECE(^DIC(220.3,I,0),U,1),1,20),?21
FOR J=1:1:8,18:1:22
SET K=$SELECT(J<18:3,1:4)
WRITE ?($X+1),$JUSTIFY($SELECT($DATA(^UTILITY($JOB,"DENTR",I,J)):^(J),1:"."),K)
+1 if Z5=U
QUIT
SET H4="STAFF TREATED"
DO HOLD2
if Z5=U
QUIT
FOR I=2:1:6,8:1:39
if $Y#(IOSL-2)=0
DO HOLD2
if Z5=U
QUIT
WRITE !,$EXTRACT($PIECE(^DIC(220.3,I,0),U,1),1,20),?22
FOR J=9:1:17
WRITE ?($X+1),$JUSTIFY($SELECT($DATA(^UTILITY($JOB,"DENTR",I,J)):^(J),1:"."),5)
+2 if Z5=U
QUIT
DO HOLD
QUIT
HDR SET H3="DENTAL SERVICE TREATMENT REPORT - "_H
SET H5=$SELECT(H1=H2:"FOR "_H1,1:"FROM "_H1_" TO "_H2)_" STATION NO.: "_Z3_$SELECT(H6="":"",1:" ")_H6
SET H7=H4_" DENTAL CATEGORY/CLASS"
+1 WRITE @IOF,?(80-$LENGTH(H3)\2),H3,!,?(80-$LENGTH(H5)\2),H5
+2 WRITE !!,?(100-$LENGTH(H7)\2),H7
QUIT
HDR1 WRITE !,"PROCEDURE",?21
FOR K=1:1:8,18:1:22
WRITE ?($X+3),K
+1 QUIT
HDR2 WRITE !,"PROCEDURE",?27,"I",?32,"II",?38,"IIA",?44,"IIB",?50,"IIC",?56,"III",?62,"IV",?69,"V",?74,"VI"
QUIT
HOLD1 DO HOLD
if Z5'=U
DO HDR
DO HDR1
QUIT
HOLD2 DO HOLD
if Z5'=U
DO HDR
DO HDR2
QUIT
HOLD if $DATA(ZTSK)!(IO'=IO(0))
QUIT
SET Z5=""
READ !,"Press return to continue, uparrow (^) to exit: ",Z5:DTIME
QUIT
NONE SET DENTF1=1
WRITE !,"There is no treatment data for review/release for the time frame you specified"
if '$DATA(ZTSK)&IO=IO(0)
WRITE *7
GOTO EXIT1
COMP WRITE !,"There "_$SELECT(DENTC(1)+DENTC=1:"is ",1:"are ")_(DENTC(1)+DENTC)_$SELECT(DENTC(1)+DENTC=1:" sitting",1:" sittings")_" in the time frame you specified. All data is complete"
QUIT
ERR WRITE !!,"The treatment data for this report is incomplete/incorrect.",!,"There are ",(DENTC(1)+DENTC)," sittings in the time frame you specified.",!,"The following errors were found:"
if '$DATA(ZTSK)&IO=IO(0)
WRITE *7,!
QUIT
CHK KILL Z
SET DENTF=0
IF $PIECE(X,U,10)=""
SET Z(1)="PROVIDER NUMBER IS MISSING"
SET DENTF=1
+1 IF $PIECE(X,U,2)=""
SET Z(2)="PATIENT SSN IS MISSING"
SET DENTF=1
+2 IF $PIECE(X,U,19)=""
SET Z(3)="PATIENT CATEGORY/CLASS IS MISSING"
SET DENTF=1
GOTO CHK1
+3 IF $PIECE(X,U,6)=""
IF $PIECE(X,U,19)<9
IF $PIECE(X,U,19)'=4
IF $PIECE(X,U,19)'=5
SET Z(4)="BED SECTION IS MISSING"
SET DENTF=1
+4 IF $PIECE(X,U,6)'=""
IF $PIECE(X,U,19)>8!($PIECE(X,U,19)=4)!($PIECE(X,U,19)=5)
SET Z(5)="BED SECTION ENTERED FOR NON INPATIENT PATIENT CATEGORY"
SET DENTF=1
CHK1 IF DENTF
SET Z=""
SET DENTF1=1
SET Y=$PIECE(X,U,1)
XECUTE ^DD("DD")
FOR L=0:0
SET Z=$ORDER(Z(Z))
if Z=""
QUIT
SET ^UTILITY($JOB,"DENTERR",(DENTC(1)+DENTC),Z)="**ERROR** TREATMENT DATE "_Y_" "_Z(Z)
+1 QUIT
EXIT if Z5=U
GOTO EXIT1
IF $DATA(DENTF1)
WRITE @IOF,*7
DO ERR
SET H=""
FOR I=1:1
if Z5=U
QUIT
SET H=$ORDER(^UTILITY($JOB,"DENTERR",H))
if H=""
QUIT
FOR J=1:1:5
if $Y#(IOSL-2)=0
DO HOLD
if Z5=U
QUIT
if $DATA(^UTILITY($JOB,"DENTERR",H,J))
WRITE !,^(J)
+1 if '$DATA(DENTF1)
DO COMP
WRITE !
if $DATA(DENTF1)&(Z5'=U)
DO HOLD
EXIT1 if Z5=U
SET DENTF1=1
KILL DENTPRV,H,H1,H2,H3,H4,H6,H7,I,J,K,L,M,X,Y,Z
QUIT