source: WorldVistAEHR/trunk/r/DSS_EXTRACTS-ECX/ECXTLOCL.m@ 814

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1ECXTLOCL ;BIR/DMA-Package Extracts for Local Use ; 17 Mar 95 / 1:04 PM
2 ;;3.0;DSS EXTRACTS;**8,49**;Dec 22, 1997
3EN ;entry point
4 ;Queuing and message sending for package extracts for local use
5 ;Input ECPACK printed name of package (e.g. Lab, Prescriptions)
6 ; ECRTN in the form of START^ROUTINE
7 ; ECGRP name of local mail group to receive summary message
8 ; (MUST BE 1 TO 5 UPPER CASE ALPHA - NO SPACES)
9 ; ECFILE file number of the local editing file
10 ; generates EC23=2nd and 3rd piece of zero node in local editing file
11 ; =YYMM of end date^pointer to 727
12 ; ECXLOGIC=Fiscal year extract logic to use
13 ;
14 S EC=$O(^ECX(727.1,"AF",ECFILE,0)),EC=$P($G(^ECX(727.1,EC,0)),U,5) I 'EC G ERROR
15 S ECED=$$FMADD^XLFDT(DT,-EC+1),ECSD=$$FMADD^XLFDT(DT,-EC)
16 ;look at results for DT-Offset so ECSD=DT-EC
17 S ECINST=+$P(^ECX(728,1,0),U) K ECXDIC S DA=ECINST,DIC="^DIC(4,",DIQ(0)="I",DIQ="ECXDIC",DR=".01;99"
18 D EN^DIQ1 S ECINST=$G(ECXDIC(4,DA,99,"I")) K DIC,DIQ,DA,DR,ECXDIC
19 S ECSDN=$$FMTE^XLFDT(ECSD),ECEDN=$$FMTE^XLFDT(ECED),ECSD1=ECSD-.1
20 I '$D(ECXLOGIC) S ECXLOGIC=$$FISCAL^ECXUTL1(ECSD)
21 L +^ECX(727,0) S EC=$P(^ECX(727,0),U,3)+1,$P(^(0),U,3,4)=EC_U_EC L -^ECX(727,0)
22 S ^ECX(727,EC,0)=EC_U_DT_U_ECPACK_U_ECSD_U_$E(ECED,1,7)
23 S ^ECX(727,EC,"HEAD")=ECHEAD
24 S ^ECX(727,EC,"FILE")=ECFILE
25 S ^ECX(727,EC,"GRP")=ECGRP
26 S ^ECX(727,EC,"L")="L"
27 S ^ECX(727,EC,"VER")=$G(ECVER)_"^"_ECXLOGIC
28 S ^ECX(727,"AC",DT,EC)="",^ECX(727,"AD",ECPACK,EC)=""
29 S ECRN=0,EC23=$$ECXYM^ECXUTL(ECED)_U_EC
30EXTRACT ;do specific extract
31 D @ECRTN
32 S TIME=$P($$HTE^XLFDT($H),":",1,2)
33 S $P(^ECX(727,$P(EC23,U,2),0),U,6)=ECRN
34 S ECLAST=$O(^ECX(ECFILE,999999999),-1),ECTOTAL=$P(^ECX(ECFILE,0),U,4)+ECRN,$P(^(0),U,3,4)=ECLAST_U_ECTOTAL K ECLAST,ECTOTAL
35 ;set piece 3 and 4 of the zero node
36 ;
37MSG ; send message to mail group 'DSS-ECGRP'
38 S XMSUB=ECINST_" - "_ECPACK_" EXTRACT FOR DSS",XMDUZ="DSS SYSTEM"
39 K XMY S XMY("G.DSS-"_ECGRP_"@"_^XMB("NETNAME"))=""
40 S ECMSG(1,0)="The LOCAL USE DSS-"_ECPACK_" extract for "_ECSDN_" through "
41 S ECMSG(2,0)=ECEDN_" was completed on "_$P(TIME,"@")_" at "_$P(TIME,"@",2)_". "
42 S ECMSG(3,0)=" "
43 S ECMSG(4,0)="A total of "_ECRN_" records were written."
44 S ECMSG(5,0)=" "
45 S X=$E(ECXLOGIC,5) S X=$S((X="")!(X=" "):"",1:"revision "_X_" of ")
46 S ECMSG(6,0)="The data was extracted using "_X_"fiscal year "_$E(ECXLOGIC,1,4)_" logic."
47 S ECMSG(7,0)=" "
48 S XMTEXT="ECMSG(" D ^XMD
49 Q
50 ;
51 Q
52ERROR ;local extract not properly setup
53 S EC(1)="The local "_ECPACK_" extract was not properly set up",EC(2)="Please review settings in file 727.1 and requeue this extract"
54 K XMY S XMY("G.DSS-"_ECGRP_"@"_^XMB("NETNAME"))="",XMTEXT="EC(",XMSUB="Local extract not properly setup",XMDUZ="DSS SYSTEM" D ^XMD
55 S ZTREQ="@" Q
Note: See TracBrowser for help on using the repository browser.