source: WorldVistAEHR/trunk/r/EVENT_CAPTURE-EC--ECT--ECX/ECBEN2U.m@ 1800

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

initial load of WorldVistAEHR

File size: 5.5 KB
Line 
1ECBEN2U ;BIR/MAM,JPW-Categories and Procedures Selection ;12 Feb 96
2 ;;2.0; EVENT CAPTURE ;**4,5,7,10,17,18,23,42,47,54,72**;8 May 96
3END Q
4HDR ;screen header
5 W @IOF,!,"Location: ",ECLN
6 W !,"DSS Unit: ",$E(ECDN,1,30) I $G(ECCN)]"" W ?48,"Category: ",$E(ECCN,1,20)
7 W !,"Ordering Section: ",ECON
8 W !,"Procedure Date: ",ECDATE,!
9 D DSP1416^ECPRVMUT(.ECPRVARY)
10 W !
11 Q
12MSG W !!,"No procedures entered. No Action Taken.",!!,"Press <RET> to continue " R X:DTIME S ECOUT=1
13 Q
14MSG1 ;
15 W !!,"Please enter the number that corresponds to the "_$S(OK:"procedure",1:"category")_" from which",!,"you would like to select a procedure. If you would like to continue",!,"with the list, press <RET>. Enter ^ to quit."
16 S CNT=CNT-5
17 Q
18HDRP ;hdr batch by proc
19 W @IOF,!,"Location: ",ECLN
20 I $G(ECCN)]"" W !,"Category: ",ECCN
21 W !,"Procedure Date: ",ECDATE
22 D DSP1442^ECPRVMUT(.ECPRVARY)
23 W !
24 Q
25PCEQST ;entry pt for PCE questions
26 S (ECDX,ECDXN,ECVST,ECSC,ECAO,ECIR,ECZEC,ECMST,ECHNC,ECCV)=""
27INP ;- Set inpatient/outpatient status
28 S ECINP=$G(ECPTSTAT)
29 D CLINIC I ECOUT Q
30 ;ask dx
31 D DIAG^ECUTL2 I ECOUT Q
32 I $P(ECPCE,"~",2)="O"&(ECINP'="O") Q
33 D VISIT
34 Q
35CLINIC ;display default clinic
36 Q:$P(ECPCE,"~",2)="N" I $P(ECPCE,"~",2)="O"&(ECINP'="O") Q
37 K DA,DIR,DIROUT,DIRUT,DTOUT,DUOUT S DIR(0)="721,26",DIR("A")="Associated Clinic",DIR("?")="An active clinic is required. Enter an active clinic or an ^ to exit"
38 I EC4,EC4N'["NO ASSOCIATED CLINIC" S DIR("B")=EC4N
39 D ^DIR K DIR
40 I Y S EC4=+Y,ECID=$P($G(^SC(+EC4,0)),"^",7)
41 I $D(DTOUT)!$D(DUOUT) S ECOUT=1 Q
42 I +EC4,'$G(ECOUT) D CLIN I 'ECPCL W !!,"You must enter an active clinic now.",! G CLINIC
43 I $D(DTOUT)!$D(DUOUT)!('Y)!(Y<0) W:$P(ECPCE,"~",2)'="N" !!,"Please note that this record cannot be sent to PCE without an active clinic.",!!
44 Q
45VISIT ;ask visit info
46 Q:ECINP="I"
47 ;
48 ;- Ask classification questions applicable to patient and file in #721
49 I $$ASKCLASS^ECUTL1(+$G(ECPT(CNT)),.ECCLFLDS,.ECOUT,ECPCE,ECINP),($O(ECCLFLDS(""))]"") D SETCLASS^ECUTL1(.ECCLFLDS)
50 I +$G(ECOUT) Q
51 K ECCLFLDS
52 Q
53PCEE ;checks edited data and sets PCE node for filing
54 S ECVST=+$P(EC(0),"^",21) I 'ECVST G PCE
55DEL ;delete visit and refresh data to PCE
56 K DA,DIE,DR S DA=ECFN,DIE=721,DR="25///@;28///@" D ^DIE K DA,DIE,DR
57 ;
58 ;* Prepare all EC records with same Visit file entry to resend to PCE
59 N ECVAR1 S ECVAR1=$$FNDVST^ECUTL(ECVST,ECFN) K ECVAR1
60 ;
61 ;- Set VALQUIET to stop Amb Care validator from broadcasting to screen
62 S VALQUIET=1,ECVV=$$DELVFILE^PXAPI("ALL",ECVST) K ECVST,VALQUIET
63PCE ;set data for PCE filing
64 Q:$P(ECPCE,"~",2)="N" I $P(ECPCE,"~",2)="O"&(ECINP'="O") Q
65 S ECREAS=""
66 ;
67 ;- Kill Reason node
68 D KILLR
69 I EC4 D CLIN^ECPCEU
70 I 'EC4 S ECREAS="Clinic missing;"
71 I 'ECDX S ECREAS="Diagnosis not entered;"
72 I EC4,'ECPCL S ECREAS=ECREAS_"Clinic inactive;"
73 I 'ECCPT S ECREAS=ECREAS_"CPT code missing;"
74 I ECREAS]"" S ^ECH(ECFN,"R")=ECREAS K ECPCL,ECREAS Q
75 I '$D(^ECH(ECFN,0)) Q
76 I '$D(^ECH(ECFN,"P")) Q
77 S PN=^ECH(ECFN,0),PNP=^ECH(ECFN,"P")
78 S PNMOD="" I $D(^ECH(ECFN,"MOD")) D
79 . N MOD,MODS S MODS=0 F S MODS=$O(^ECH(ECFN,"MOD",MODS)) Q:'MODS D
80 . . S MOD=$P($G(^ECH(ECFN,"MOD",MODS,0)),U)
81 . . S MOD=$$MOD^ICPTMOD(MOD,"I",$P(PN,U,3)) I +MOD<0 Q
82 . . S PNMOD=$S(PNMOD'="":PNMOD_";",1:"")_$P(MOD,U,2)
83SET ;set data pieces
84 S ECP3=+$P(PN,"^",3) I ECP3'["." K ECP3 D DELNOD Q
85 S ECP2=+$P(PN,"^",2) I 'ECP2 K ECP2 D DELNOD Q
86 S ECP19=+$P(PN,"^",19) I 'ECP19 K ECP19 D DELNOD Q
87 S ECP4=+$P(PN,"^",4) I 'ECP4 K ECP4 D DELNOD Q
88 S ECP20=+$P(PN,"^",20) I 'ECP20 K ECP20 D DELNOD Q
89 S ECP10=+$P(PN,"^",10) I 'ECP10 K ECP10 D DELNOD Q
90 S ECPP1=+$P(PNP,"^") I 'ECPP1 K ECPP1 D DELNOD Q
91 S ECPP2=+$P(PNP,"^",2) I 'ECPP2 K ECPP2 D DELNOD Q
92 S ECPP3=$P(PNP,"^",3),ECPP3=$S(ECPP3="Y":1,ECPP3="N":0,1:"")
93 S ECPP4=$P(PNP,"^",4),ECPP4=$S(ECPP4="Y":1,ECPP4="N":0,1:"")
94 S ECPP5=$P(PNP,"^",5),ECPP5=$S(ECPP5="Y":1,ECPP5="N":0,1:"")
95 S ECPP6=$P(PNP,"^",6),ECPP6=$S(ECPP6="Y":1,ECPP6="N":0,1:"")
96 S ECPP9=$P(PNP,"^",9),ECPP9=$S(ECPP9="Y":1,ECPP9="N":0,1:"")
97 S ECPP10=$P(PNP,"^",10),ECPP10=$S(ECPP10="Y":1,ECPP10="N":0,1:"")
98 S ECPP11=$P(PNP,"^",11),ECPP11=$S(ECPP11="Y":1,ECPP11="N":0,1:"")
99 S ECPP1A="" I $P(PN,"^",9)["EC" S ECPP1A=$G(^EC(725,+$P(PN,"^",9),0)),ECPP1A=$P(ECPP1A,"^",2)_" "_$P(ECPP1A,"^")
100 S ECELIG=$S($G(ECELIG):ECELIG,1:"")
101NODE ;sets "PCE" node
102 ;d/t~dfn~hosp loc~inst~dss id~*prov(not filled)~*prov2~*prov3~vol~cpt~dx~ao~rad~env~sc~ecs nat # & name~eligibility~mst~hnc~cv
103 S PNODE=ECP3_"~"_ECP2_"~"_ECP19_"~"_ECP4_"~"_ECP20_"~~~~"_ECP10_"~"_ECPP1_"~"_ECPP2_"~"_ECPP3_"~"_ECPP4_"~"_ECPP5_"~"_ECPP6_"~"_ECPP1A_"~"_ECELIG_"~"_ECPP9_"~"_ECPP10_"~"_ECPP11
104 S ^ECH(ECFN,"PCE")=PNODE
105 ;set "PCE1" node
106 ;CPT modifier1;CPT modifier 2;CPT modifier 3;...CPT modifier n
107 I PNMOD'="" S ^ECH(ECFN,"PCE1")=PNMOD
108 S DA=ECFN,DIE=721,DR="31////"_ECDT D ^DIE K DA,DIE,DR
109 K ECP2,ECP3,ECP4,ECP10,ECP19,ECP20,ECPP1,ECPP1A,ECPP2,ECPP3,ECPP4,ECPP5,ECPP6,ECPP9,ECPP10,ECPP11,ECREAS,ECPCL,PN,PNP,PNODE,ECELIG,PNMOD
110 Q
111CLIN ;check for active associated clinic
112 S MSG1=1,MSG2=0
113 D CLIN^ECPCEU
114 I 'ECPCL D
115 .W !!,"The clinic ",$S(MSG1:"associated with",1:"you selected for")," this procedure ",$S(MSG2:"has not been entered",1:"is inactive"),"."
116 .W !,"Workload data cannot be sent to PCE for this procedure with ",!,$S(MSG2:"a missing",1:"an inactive")," clinic."
117 S (MSG1,MSG2)=0
118 Q
119 ;
120 ;
121KILLR ;- Kill 'R' (Reason) node
122 ;
123 K ^ECH(ECFN,"R")
124 Q
125 ;
126 ;
127DELNOD ;- Delete 'PCE' and 'Send' nodes
128 ;
129 N DA,DIE,DR
130 ;
131 ;- Lock node
132 L +^ECH(ECFN):5 Q:'$T
133 S DA=ECFN
134 S DIE="^ECH("
135 S DR="30////@;31////@;37////@"
136 ;
137 ;- Delete contents
138 D ^DIE
139 ;
140 ;- Unlock node
141 L -^ECH(ECFN)
142 Q
Note: See TracBrowser for help on using the repository browser.