source: FOIAVistA/trunk/r/EVENT_CAPTURE-EC--ECT--ECX/ECEDU.m@ 1742

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

initial load of FOIAVistA 6/30/08 version

File size: 3.1 KB
Line 
1ECEDU ;BIR/MAM,JPW-Enter Event Capture Data (cont'd) ;6 Mar 96
2 ;;2.0; EVENT CAPTURE ;**10,18,23,47,63,72**;8 May 96
3HDR ;hdr for filing
4 W @IOF,!,"ENTERING A NEW PROCEDURE FOR "_ECPAT_" ...",!!,"LOCATION: "_ECLN,!,"SERVICE: "_ECSN,!,"SECTION: "_ECMN,!,"CATEGORY: "_ECCN,!!,"PROCEDURE: "
5 W $S(ECCPT="":"",1:ECPTCD_" ")_$E(ECPN,1,50)
6 I SYN]"",SYN'["NOT DEFINED" W " ["_SYN_"]"
7 W " (#"_NATN_")"
8 Q
9MSGC ;msg cat
10 W !!,"Please enter the number that corresponds to the "_$S(EC1:"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."
11 S CNT=CNT-5
12 Q
13HDR1 ; heading
14 W @IOF,!,"Patient: "_ECPAT,?40,"Procedure Date: "_ECDATE,!!,"Location: "_ECLN,?40,"Service: "_ECSN,!,"Section: "_ECMN,?40,"DSS Unit: "_ECDN W:$D(ECCN) !,"Category: "_ECCN
15 Q
16MSG W !!,"No procedures entered. No Action Taken.",!!,"Press <RET> to continue " R X:DTIME S ECOUT=1
17 Q
18SETE ;set edit
19 N ECPXD
20 S DA=+EC(EC),EC(0)=^ECH(DA,0),ECC=+$P(EC(0),"^",8),ECCN=$S('ECC:"None",$P($G(^EC(726,ECC,0)),"^")]"":$P(^(0),"^"),1:"UNKNOWN")
21 S (ECP,ECPROF)=$P(EC(0),"^",9)
22 S ECPSY=+$O(^ECJ("AP",+ECL,+ECD,ECC,+ECP,""))
23 S ECPSYN=$P($G(^ECJ(ECPSY,"PRO")),"^",2)
24 S ECFILE=$S(ECPROF["EC":725,ECPROF["ICPT":81,1:"UNKNOWN")
25 I ECFILE="UNKNOWN" S ECPN="UNKNOWN"
26 S ECCPT=$S(ECP["ICPT":+ECP,1:$P($G(^EC(725,+ECP,0)),U,5))
27 S (ECPTCD,ECPXD)="" I ECCPT'="" D
28 . S ECPXD=$$CPT^ICPTCOD(ECCPT,$P(EC(0),U,3)) I +ECPXD>0 S ECPTCD=$P(ECPXD,U,2)
29 I ECFILE=81 S ECPN=$S($P(ECPXD,U,3)]"":$P(ECPXD,U,3),1:"UNKNOWN")
30 I ECFILE=725 S ECPN=$S($P($G(^EC(725,+ECP,0)),"^")]"":$P(^(0),"^"),1:"UNKNOWN")
31HDRE ; hdr for editing
32 W @IOF,!,"EDITING A PROCEDURE FOR "_ECPAT_" ...",!!,"LOCATION: "_ECLN,!,"SERVICE: "_ECSN,!,"SECTION: "_ECMN,!,"CATEGORY: "_ECCN,!,"PROCEDURE: "_$S(ECCPT="":"",1:ECPTCD_" ")_ECPN_$S(ECPSYN="":"",1:" ["_ECPSYN_"]")
33 Q
34DXEDT ;ALB/JAM - Edit Primary and multiple secondary dx codes
35 N PXUPD,IEN,ECPDX,ECDXS,ECDT,ECDXI
36 S EC4=$P($G(^ECH(ECFN,0)),"^",19),(ECDX,ECDXN)="",ECDT=ECNEWDT
37 S ECPDX=$$PDXCK^ECUTL2(ECDFN,ECNEWDT,ECL,EC4),IEN="" K ECDXIEN(ECFN)
38 ;update primary diagnoses code
39 S ECDX=ECDX1,ECDXI=$$ICDDX^ICDCODE(ECDX1,ECNEWDT),ECDXN=$P(ECDXI,U,2)
40 W !,"Primary ICD-9 Code: ",ECDXN," ",$P(ECDXI,U,4)
41 D PDX^ECUTL2 I ECOUT=1 Q
42 S ECDX1=ECDX
43 S DA=ECFN,DR="20////"_ECDX1 D ^DIE K DIE
44 ;check for any changes to primary dx
45 S ECDX1=X,IEN=""
46 F S IEN=$O(ECDXIEN(IEN)) Q:IEN="" I $P(ECDXIEN(IEN),U,2)'=ECDX1 D Q
47 .W !?5,"WARNING: More than 1 Primary diagnoses exist for this encounter. All"
48 .W !?14,"Procedures will be updated to have same primary & secondary dx"
49 ; update secondary diagnosis codes
50 D SDX^ECUTL2 S DXS=""
51 K ECDXX M ECDXX=ECDXS K ECDXS
52 ;Update all procedures for the encounter with same primary dx
53 S PXUPD=$$PXUPD^ECUTL2(ECDFN,ECNEWDT,ECL,EC4,ECDX1,.ECDXX)
54 K PXUPD,ECDXX S DA=ECFN
55 Q
56 F S DXS=$O(ECDXS(DXS)) Q:DXS="" S DXSIEN=$P(ECDXS(DXS),U) D:DXSIEN>0
57 . K DIC,DD,DO S DIC(0)="L",DA(1)=ECFN,DIC="^ECH("_DA(1)_","_"""DX"""_","
58 . S DIC("P")=$P(^DD(721,38,0),U,2),X=DXSIEN D FILE^DICN
59 K DXSIEN,DXS,ECDXX,DIC M ECDXX=ECDXS K ECDXS
Note: See TracBrowser for help on using the repository browser.