source: WorldVistAEHR/trunk/r/EVENT_CAPTURE-EC--ECT--ECX/ECBEPF.m@ 1361

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

initial load of WorldVistAEHR

File size: 2.6 KB
Line 
1ECBEPF ;BIR/MAM,JPW-Stuff Batch Entry by Procedure (cont'd) ;2 Mar 96
2 ;;2.0; EVENT CAPTURE ;**4,5,13,17,18,23,42,54,72**;8 May 96
3CRAM ; entry
4 S ECDT=$P(ECA,"^"),ECL=$P(ECA,"^",2),ECS=$P(ECA,"^",3),ECM=$P(ECA,"^",4),ECD=$P(ECA,"^",5)
5 S ECPCE=$P(ECA,"^",6)
6 S (CNT,CNT1)=0 F S CNT1=$O(ECPT(CNT1)) Q:'CNT1 D SET F S CNT=$O(ECEC(CNT)) Q:'CNT D DIE
7END D ^ECKILL K DLAYGO S:$D(ZTQUEUED) ZTREQ="@"
8 Q
9SET ;
10 S ECPS=$P(ECPT(CNT1),"^"),ECO=$P(ECPT(CNT1),"^",3),ECV=+$P(ECPT(CNT1),"^",5)
11 S ECDX=$P(ECPT(CNT1),"^",6),ECINP=$P(ECPT(CNT1),"^",7),ECVST=$P(ECPT(CNT1),"^",8),ECSC=$P(ECPT(CNT1),"^",9),ECAO=$P(ECPT(CNT1),"^",10),ECIR=$P(ECPT(CNT1),"^",11)
12 S ECZEC=$P(ECPT(CNT1),"^",12),EC4=$P(ECPT(CNT1),"^",13),ECID=$P(ECPT(CNT1),"^",14)
13 S ECMST=$P(ECPT(CNT1),"^",15),ECHNC=$P(ECPT(CNT1),"^",16),ECCV=$P(ECPT(CNT1),"^",17)
14 S ECELIG=$G(ECELPT(CNT1))
15 Q
16DIE ;
17 L +^ECH(0) S ECRN=$P(^ECH(0),"^",3)+1 I $D(^ECH(ECRN)) S $P(^ECH(0),"^",3)=$P(^ECH(0),"^",3)+1 L -^ECH(0) G DIE
18 L -^ECH(0) K DD,DO,DIC S X=ECRN,DIC(0)="L",DLAYGO=721,DIC="^ECH(" D FILE^DICN K DIC S ECFN=+Y
19 S ECNODE=ECEC(CNT),ECC=+$P(ECNODE,"^"),ECP=$P(ECNODE,"^",2),ECPRPTR=$P(ECNODE,"^",12)
20 S ECCPT=$P(ECNODE,"^",9)
21 ; set the zero node
22 S ^ECH(ECFN,0)=ECFN_"^"_ECPS_"^"_ECDT_"^"_ECL_"^"_ECS_"^"_ECM_"^"_ECD_"^"_ECC_"^"_ECP_"^"_ECV_"^^"_ECO_"^"_ECDUZ_"^^^^^^"_EC4_"^"_ECID_"^"_ECVST_"^"_ECINP
23 ;ALB/JAM file multiple providers (EC*2*72)
24 S ECFIL=$$FILPRV^ECPRVMUT(ECFN,.ECPRVARY,.ECOUT) K ECFIL
25 ;ALB/ESD - Set procedure reason into zero node
26 I +ECPRPTR S $P(^ECH(ECFN,0),"^",23)=+ECPRPTR
27 ;set the "P" node
28 S ^ECH(ECFN,"P")=ECCPT_"^"_ECDX_"^"_ECAO_"^"_ECIR_"^"_ECZEC_"^"_ECSC
29 S $P(^ECH(ECFN,"P"),"^",9,12)=ECMST_"^"_ECHNC_"^"_ECCV
30 ;add secondary diagnosis codes
31 I $O(ECPT(CNT1,"DXS",""))'="" D K DXSIEN,DXS
32 . S DXS="" F S DXS=$O(ECPT(CNT1,"DXS",DXS)) Q:DXS="" D
33 . . S DXSIEN=$P(ECPT(CNT1,"DXS",DXS),U) I DXSIEN<0 Q
34 . . K DIC,DD,DO
35 . . S DIC(0)="L",DA(1)=ECFN,DIC="^ECH("_DA(1)_","_"""DX"""_","
36 . . S DIC("P")=$P(^DD(721,38,0),U,2),X=DXSIEN
37 . . D FILE^DICN
38 K ECDXX M ECDXX=ECPT(CNT1,"DXS")
39 S PXUPD=$$PXUPD^ECUTL2(ECPS,ECDT,ECL,EC4,ECDX,.ECDXX,ECFN) K PXUPD,ECDXX
40 ;add CPT procedure modifiers
41 I $O(ECEC(CNT,"MOD",""))'="" D K MODIEN,MOD
42 . S MOD="" F S MOD=$O(ECEC(CNT,"MOD",MOD)) Q:MOD="" D
43 . . S MODIEN=$P(ECEC(CNT,"MOD",MOD),U,2) I MODIEN<0 Q
44 . . K DIC,DD,DO
45 . . S DIC(0)="L",DA(1)=ECFN,DIC="^ECH("_DA(1)_","_"""MOD"""_","
46 . . S DIC("P")=$P(^DD(721,36,0),U,2),X=MODIEN
47 . . D FILE^DICN
48XREF ; sets crossreferences
49 S DIK="^ECH(",DA=ECFN D IX1^DIK K DA,DIK
50PCE ;format data to send PCE
51 Q:$P(ECPCE,"~",2)="N" I $P(ECPCE,"~",2)="O"&(ECINP'="O") Q
52 D PCE^ECBEN2U
53 Q
Note: See TracBrowser for help on using the repository browser.