A1B2MUT ;ALB/AAS - BILLING UTILITY ROUTINE ;16-JAN-91
;;Version 1.55 (local for MAS v5 sites);;
;
;written as war breaks out
;
;
ADM ; -- find local patient dfn and ods admission entry number from ptf entry
; -- input DFN := entry in dpt
; a1b2ptf := entry in ^dgpt
; -- output a1b2adm := entry in 11500.2
S DFN=+^DGPT(A1B2PTF,0),A1B2ADM=""
S A1B2ADM1=$O(^DGPM("APTF",A1B2PTF,0)) G:'A1B2ADM1 ADMQ
S A1B2ADM=$S($D(^DGPM(A1B2ADM1,"ODS")):$P(^("ODS"),"^",4),1:"")
ADMQ K A1B2ADM1 Q
;
PTF ; -- find ptf entry number from ods admission entry
; -- input a1b2adm := entry in 11500.2
; -- output a1b2ptf :=entry in ^dgpt
S A1B2ADM2=$O(^DGPM("AODSA",A1B2ADM,0)),A1B2ADM="" G:'A1B2ADM2 PTFQ
S A1B2PTF=$S($D(^DGPM(A1B2ADM2,0)):$P(^(0),"^",16),1:"")
PTFQ K A1B2ADM2 Q
Q
;
ASKAD ; -- ask ods admission
;I '$D(A1B2NTY) D FAC^A1B2UTL
S A1B2ADM=""
S DIC("S")="I $P(^(0),U,15),$P(^(0),U,7)=A1B2FN"
S DIC("A")="Select ODS ADMISSION DATE/TIME: ",DIC="^A1B2(11500.2,",DIC(0)="AEQMN" D ^DIC K DIC S A1B2Y=Y G:+Y<1 ASKADQ
S A1B2ADM=+A1B2Y,DFN=$P(^A1B2(11500.2,A1B2ADM,0),"^",12)
ASKADQ Q
;
EN1 ; -- local site enter/edit of cost data
D FAC^A1B2UTL
D ASKAD G:'A1B2ADM EN1Q W !
S A1B2NK="" D DISP1
D EDIT
W ! G EN1
EN1Q K A1B2MAIN,DIC,DIE,X,Y,A1B2Y,A1B2ADM,A1B2NOD,A1B2YY,DA,DR,DFN,A1B2NK
I '$D(A1B2NTY) K A1B2FN,A1B2FNME
Q
;
EDIT ; -- input cost data,local input
S DLAYGO=11500.64,DIC("A")="Select COST DATE: ",DIC="^A1B2(11500.64,",DIC(0)="AEQLMZ" D DICDR1
D ^DIC Q:Y<1 K DIC S DA=+Y,A1B2NOD=Y(0)
S DIE="^A1B2(11500.64,",DR="[A1B2 ENTRY]"
D ^DIE
S A1B2YY=^A1B2(11500.64,DA,0) I A1B2YY'=A1B2NOD,$D(^(1)),+^(1)'=2 S DR="1.01////3" D ^DIE
K DIE,DR,DA,DLAYGO
W ! G EDIT
Q
;
DICDR1 ; --set dic(dr) and dic(s) for files 11500.61 => 11500.64
S DIC("DR")=".02////"_A1B2ADM_";.07////"_A1B2FN_";.08////"_A1B2FNME_";.15////1;1.05////"_DUZ_";1.01////2"_$S($D(A1B2PTF):";.13////"_A1B2PTF,1:"")_";.12////"_DFN_";.03;.04;.05"
S DIC("S")="I $P(^(0),U,15),$P(^(0),U,7)=A1B2FN,$P(^(0),U,2)=A1B2ADM"
Q
;
EN2 ; -- Print billing data
I '$D(A1B2NTY) D FAC^A1B2UTL
S L=0,DIC="^A1B2(11500.2,",FLDS="[A1B2 BILLING DATA]",BY="[A1B2 BILLING DATA]"
S A1B2FL=11500.2 D DIS^A1B2UTL
D EN1^DIP
EN2Q K DIC,FLDS,BY,X,X1,D,A1B2FL
Q
;
DISP ; -- display billing data header, and data
I '$D(A1B2NTY) D FAC^A1B2UTL
W ! D ASKAD G:'A1B2ADM DISPQ
DISP1 D HOME^%ZIS K DXS S D0=+A1B2ADM,DN=1
D HEAD
S ^UTILITY($J,1)="S A1B2X=X D PAUSE^A1B2MUT Q:'DN D HEAD^A1B2MUT S X=A1B2X W !"
D ^A1B2CO,PAUSE:DN
I '$D(A1B2NK) G DISP
DISPQ I $D(A1B2NK) K A1B2X,A1B2ANS,A1B2I,A1B2Y,DXS,DN,D0,X,X1,C,D,DIXX Q
K A1B2ADM,A1B2X,A1B2ANS,A1B2BR,A1B2I,A1B2VR,A1B2Y,DFN,DXS,DN,D0,X,X1,C,D,DIXX
I '$D(A1B2NTY) K A1B2FN,A1B2FNME
K A1B2X,A1B2ANS,A1B2I,A1B2Y,DXS,DN,D0,X,X1,C,D,DIXX
Q
;
HEAD ;
W @IOF
D ^A1B2COH
Q
PAUSE ;
F A1B2I=0:0 Q:$Y>(IOSL-2) W !
R "Press RETURN to continue:",A1B2ANS:DTIME I A1B2ANS["^" S DN=0
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HA1B2MUT 3013 printed Dec 13, 2024@02:21:13 Page 2
A1B2MUT ;ALB/AAS - BILLING UTILITY ROUTINE ;16-JAN-91
+1 ;;Version 1.55 (local for MAS v5 sites);;
+2 ;
+3 ;written as war breaks out
+4 ;
+5 ;
ADM ; -- find local patient dfn and ods admission entry number from ptf entry
+1 ; -- input DFN := entry in dpt
+2 ; a1b2ptf := entry in ^dgpt
+3 ; -- output a1b2adm := entry in 11500.2
+4 SET DFN=+^DGPT(A1B2PTF,0)
SET A1B2ADM=""
+5 SET A1B2ADM1=$ORDER(^DGPM("APTF",A1B2PTF,0))
if 'A1B2ADM1
GOTO ADMQ
+6 SET A1B2ADM=$SELECT($DATA(^DGPM(A1B2ADM1,"ODS")):$PIECE(^("ODS"),"^",4),1:"")
ADMQ KILL A1B2ADM1
QUIT
+1 ;
PTF ; -- find ptf entry number from ods admission entry
+1 ; -- input a1b2adm := entry in 11500.2
+2 ; -- output a1b2ptf :=entry in ^dgpt
+3 SET A1B2ADM2=$ORDER(^DGPM("AODSA",A1B2ADM,0))
SET A1B2ADM=""
if 'A1B2ADM2
GOTO PTFQ
+4 SET A1B2PTF=$SELECT($DATA(^DGPM(A1B2ADM2,0)):$PIECE(^(0),"^",16),1:"")
PTFQ KILL A1B2ADM2
QUIT
+1 QUIT
+2 ;
ASKAD ; -- ask ods admission
+1 ;I '$D(A1B2NTY) D FAC^A1B2UTL
+2 SET A1B2ADM=""
+3 SET DIC("S")="I $P(^(0),U,15),$P(^(0),U,7)=A1B2FN"
+4 SET DIC("A")="Select ODS ADMISSION DATE/TIME: "
SET DIC="^A1B2(11500.2,"
SET DIC(0)="AEQMN"
DO ^DIC
KILL DIC
SET A1B2Y=Y
if +Y<1
GOTO ASKADQ
+5 SET A1B2ADM=+A1B2Y
SET DFN=$PIECE(^A1B2(11500.2,A1B2ADM,0),"^",12)
ASKADQ QUIT
+1 ;
EN1 ; -- local site enter/edit of cost data
+1 DO FAC^A1B2UTL
+2 DO ASKAD
if 'A1B2ADM
GOTO EN1Q
WRITE !
+3 SET A1B2NK=""
DO DISP1
+4 DO EDIT
+5 WRITE !
GOTO EN1
EN1Q KILL A1B2MAIN,DIC,DIE,X,Y,A1B2Y,A1B2ADM,A1B2NOD,A1B2YY,DA,DR,DFN,A1B2NK
+1 IF '$DATA(A1B2NTY)
KILL A1B2FN,A1B2FNME
+2 QUIT
+3 ;
EDIT ; -- input cost data,local input
+1 SET DLAYGO=11500.64
SET DIC("A")="Select COST DATE: "
SET DIC="^A1B2(11500.64,"
SET DIC(0)="AEQLMZ"
DO DICDR1
+2 DO ^DIC
if Y<1
QUIT
KILL DIC
SET DA=+Y
SET A1B2NOD=Y(0)
+3 SET DIE="^A1B2(11500.64,"
SET DR="[A1B2 ENTRY]"
+4 DO ^DIE
+5 SET A1B2YY=^A1B2(11500.64,DA,0)
IF A1B2YY'=A1B2NOD
IF $DATA(^(1))
IF +^(1)'=2
SET DR="1.01////3"
DO ^DIE
+6 KILL DIE,DR,DA,DLAYGO
+7 WRITE !
GOTO EDIT
+8 QUIT
+9 ;
DICDR1 ; --set dic(dr) and dic(s) for files 11500.61 => 11500.64
+1 SET DIC("DR")=".02////"_A1B2ADM_";.07////"_A1B2FN_";.08////"_A1B2FNME_";.15////1;1.05////"_DUZ_";1.01////2"_$SELECT($DATA(A1B2PTF):";.13////"_A1B2PTF,1:"")_";.12////"_DFN_";.03;.04;.05"
+2 SET DIC("S")="I $P(^(0),U,15),$P(^(0),U,7)=A1B2FN,$P(^(0),U,2)=A1B2ADM"
+3 QUIT
+4 ;
EN2 ; -- Print billing data
+1 IF '$DATA(A1B2NTY)
DO FAC^A1B2UTL
+2 SET L=0
SET DIC="^A1B2(11500.2,"
SET FLDS="[A1B2 BILLING DATA]"
SET BY="[A1B2 BILLING DATA]"
+3 SET A1B2FL=11500.2
DO DIS^A1B2UTL
+4 DO EN1^DIP
EN2Q KILL DIC,FLDS,BY,X,X1,D,A1B2FL
+1 QUIT
+2 ;
DISP ; -- display billing data header, and data
+1 IF '$DATA(A1B2NTY)
DO FAC^A1B2UTL
+2 WRITE !
DO ASKAD
if 'A1B2ADM
GOTO DISPQ
DISP1 DO HOME^%ZIS
KILL DXS
SET D0=+A1B2ADM
SET DN=1
+1 DO HEAD
+2 SET ^UTILITY($JOB,1)="S A1B2X=X D PAUSE^A1B2MUT Q:'DN D HEAD^A1B2MUT S X=A1B2X W !"
+3 DO ^A1B2CO
if DN
DO PAUSE
+4 IF '$DATA(A1B2NK)
GOTO DISP
DISPQ IF $DATA(A1B2NK)
KILL A1B2X,A1B2ANS,A1B2I,A1B2Y,DXS,DN,D0,X,X1,C,D,DIXX
QUIT
+1 KILL A1B2ADM,A1B2X,A1B2ANS,A1B2BR,A1B2I,A1B2VR,A1B2Y,DFN,DXS,DN,D0,X,X1,C,D,DIXX
+2 IF '$DATA(A1B2NTY)
KILL A1B2FN,A1B2FNME
+3 KILL A1B2X,A1B2ANS,A1B2I,A1B2Y,DXS,DN,D0,X,X1,C,D,DIXX
+4 QUIT
+5 ;
HEAD ;
+1 WRITE @IOF
+2 DO ^A1B2COH
+3 QUIT
PAUSE ;
+1 FOR A1B2I=0:0
if $Y>(IOSL-2)
QUIT
WRITE !
+2 READ "Press RETURN to continue:",A1B2ANS:DTIME
IF A1B2ANS["^"
SET DN=0
+3 QUIT