source: WorldVistAEHR/trunk/r/OPERATIONS_WITH_DESERT_STORM-A1B2/A1B2MUT.m@ 1806

Last change on this file since 1806 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1A1B2MUT ;ALB/AAS - BILLING UTILITY ROUTINE ;16-JAN-91
2 ;;Version 1.55 (local for MAS v5 sites);;
3 ;
4 ;written as war breaks out
5 ;
6 ;
7ADM ; -- find local patient dfn and ods admission entry number from ptf entry
8 ; -- input DFN := entry in dpt
9 ; a1b2ptf := entry in ^dgpt
10 ; -- output a1b2adm := entry in 11500.2
11 S DFN=+^DGPT(A1B2PTF,0),A1B2ADM=""
12 S A1B2ADM1=$O(^DGPM("APTF",A1B2PTF,0)) G:'A1B2ADM1 ADMQ
13 S A1B2ADM=$S($D(^DGPM(A1B2ADM1,"ODS")):$P(^("ODS"),"^",4),1:"")
14ADMQ K A1B2ADM1 Q
15 ;
16PTF ; -- find ptf entry number from ods admission entry
17 ; -- input a1b2adm := entry in 11500.2
18 ; -- output a1b2ptf :=entry in ^dgpt
19 S A1B2ADM2=$O(^DGPM("AODSA",A1B2ADM,0)),A1B2ADM="" G:'A1B2ADM2 PTFQ
20 S A1B2PTF=$S($D(^DGPM(A1B2ADM2,0)):$P(^(0),"^",16),1:"")
21PTFQ K A1B2ADM2 Q
22 Q
23 ;
24ASKAD ; -- ask ods admission
25 ;I '$D(A1B2NTY) D FAC^A1B2UTL
26 S A1B2ADM=""
27 S DIC("S")="I $P(^(0),U,15),$P(^(0),U,7)=A1B2FN"
28 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
29 S A1B2ADM=+A1B2Y,DFN=$P(^A1B2(11500.2,A1B2ADM,0),"^",12)
30ASKADQ Q
31 ;
32EN1 ; -- local site enter/edit of cost data
33 D FAC^A1B2UTL
34 D ASKAD G:'A1B2ADM EN1Q W !
35 S A1B2NK="" D DISP1
36 D EDIT
37 W ! G EN1
38EN1Q K A1B2MAIN,DIC,DIE,X,Y,A1B2Y,A1B2ADM,A1B2NOD,A1B2YY,DA,DR,DFN,A1B2NK
39 I '$D(A1B2NTY) K A1B2FN,A1B2FNME
40 Q
41 ;
42EDIT ; -- input cost data,local input
43 S DLAYGO=11500.64,DIC("A")="Select COST DATE: ",DIC="^A1B2(11500.64,",DIC(0)="AEQLMZ" D DICDR1
44 D ^DIC Q:Y<1 K DIC S DA=+Y,A1B2NOD=Y(0)
45 S DIE="^A1B2(11500.64,",DR="[A1B2 ENTRY]"
46 D ^DIE
47 S A1B2YY=^A1B2(11500.64,DA,0) I A1B2YY'=A1B2NOD,$D(^(1)),+^(1)'=2 S DR="1.01////3" D ^DIE
48 K DIE,DR,DA,DLAYGO
49 W ! G EDIT
50 Q
51 ;
52DICDR1 ; --set dic(dr) and dic(s) for files 11500.61 => 11500.64
53 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"
54 S DIC("S")="I $P(^(0),U,15),$P(^(0),U,7)=A1B2FN,$P(^(0),U,2)=A1B2ADM"
55 Q
56 ;
57EN2 ; -- Print billing data
58 I '$D(A1B2NTY) D FAC^A1B2UTL
59 S L=0,DIC="^A1B2(11500.2,",FLDS="[A1B2 BILLING DATA]",BY="[A1B2 BILLING DATA]"
60 S A1B2FL=11500.2 D DIS^A1B2UTL
61 D EN1^DIP
62EN2Q K DIC,FLDS,BY,X,X1,D,A1B2FL
63 Q
64 ;
65DISP ; -- display billing data header, and data
66 I '$D(A1B2NTY) D FAC^A1B2UTL
67 W ! D ASKAD G:'A1B2ADM DISPQ
68DISP1 D HOME^%ZIS K DXS S D0=+A1B2ADM,DN=1
69 D HEAD
70 S ^UTILITY($J,1)="S A1B2X=X D PAUSE^A1B2MUT Q:'DN D HEAD^A1B2MUT S X=A1B2X W !"
71 D ^A1B2CO,PAUSE:DN
72 I '$D(A1B2NK) G DISP
73DISPQ I $D(A1B2NK) K A1B2X,A1B2ANS,A1B2I,A1B2Y,DXS,DN,D0,X,X1,C,D,DIXX Q
74 K A1B2ADM,A1B2X,A1B2ANS,A1B2BR,A1B2I,A1B2VR,A1B2Y,DFN,DXS,DN,D0,X,X1,C,D,DIXX
75 I '$D(A1B2NTY) K A1B2FN,A1B2FNME
76 K A1B2X,A1B2ANS,A1B2I,A1B2Y,DXS,DN,D0,X,X1,C,D,DIXX
77 Q
78 ;
79HEAD ;
80 W @IOF
81 D ^A1B2COH
82 Q
83PAUSE ;
84 F A1B2I=0:0 Q:$Y>(IOSL-2) W !
85 R "Press RETURN to continue:",A1B2ANS:DTIME I A1B2ANS["^" S DN=0
86 Q
Note: See TracBrowser for help on using the repository browser.