source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LREPISRV.m@ 1604

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

initial load of WorldVistAEHR

File size: 5.0 KB
Line 
1LREPISRV ;DALOI/RLM-EPI data server ;8/2/2000
2 ;;5.2;LAB SERVICE;**260,281**;Sep 27, 1994
3 ; Reference to $$SITE^VASITE supported by IA #10112
4 ; Reference to ^%ZOSF supported by IA #10096
5 ; Reference to ^ICD9( supported by IA #10082
6 ; Reference to ^ORD(101 supported by IA #872
7START ;
8 K ^TMP($J,"LREPDATA")
9 S LREPST=$P($$SITE^VASITE,"^",2)
10 ;Determine station number
11 S X=XQSUB X ^%ZOSF("UPPERCASE") S LREPSUB=Y
12 S ^TMP($J,"LREPDATA",1)=LREPSUB_" triggered at "_LREPST_" by "_XMFROM_" on "_XQDATE
13 ;The first line of the message tells who requested the action and when
14 S ^TMP($J,"LREPDATA",2)="No"_$S(LREPSUB["REPORT":" report generated",1:"thing done")_" at "_LREPST
15 ;The second line tells when the server is activated and no data can be gathered from the MailMan message.
16 S LREPLNT=1
17 I LREPSUB["REPORT" G REPORT
18 ;If the subject contains "REPORT" send a report
19EXIT ;If all went well, report that too.
20 S %H=$H D YMD^%DTC S XMDUN="EPI SYSTEM",XMDUZ=".5",XMSUB=LREPST_" EPI ("_X_%_")",XMTEXT="^TMP($J,""LREPDATA"","
21 S XMY("G.EPI-SITE@CINCINNATI.VA.GOV")=""
22 ;S XMY("ANZALDUA,CAROL@VAHVSS.FO-ALBANY.MED.VA.GOV")="" ;,XMY("CAROL.ANZALDUA@MED.VA.GOV")=""
23 D ^XMD
24 ;Mail the errors and successes back to the EPI group at Cincinnati.
25 K ^TMP($J,"LREPDATA")
26 K %,%DT,%H,D,DIC,X,XMDUN,XMDUZ,XMER,XMFROM,XMREC,XMRG,XMSUB,XMTEXT,XMY,XMZ,XQDATE,XQSUB,Y,LREPA,LREPB,LREPDA,LREPDA1,LREPDATA,LREPDFN,LREPDM,LREPDOC
27 K LREPDOM,LREPDTA,LREPED,LREPER,LREPLNT,LREPNM,LREPPT,LREPSD1,LREPSDT,LREPSSN,LREPST,LREPSUB,LREPTC,YSPR,LREPWB,LREPX,ZTQUEUED,ZTSK
28 K LRICD9,LRA,LRCOND,LRDATA,LRFILL,LRI,LRPATH,LRTEST
29 Q
30 ;F X XMREC Q:XMER<0 S XMRG=$TR(XMRG,"- ","") D
31REPORT ;send report
32 S $P(LRFILL," ",256)=""
33 S LRA=0 F S LRA=$O(^LAB(69.5,LRA)) Q:'LRA D
34 . S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)="*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*="
35 . S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)="Pathogen Ref# Cy LD Protocol FPTF Active"
36 . S LRPATH=$G(^LAB(69.5,LRA,0))
37 . I LRPATH="" S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)="IEN # "_LRA_" damaged. (NULL)" Q
38 . I '$P(LRPATH,"^",7) S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)="IEN # "_LRA_" damaged. (No Protocol)" Q
39 . S LRDATA=$P(LRPATH,"^")_$E(LRFILL,$L($P(LRPATH,"^")),30)_$J($P(LRPATH,"^",9),4)_$J($P(LRPATH,"^",5),3)_$J($P(LRPATH,"^",3),3)_$J($P(^ORD(101,$P(LRPATH,"^",7),0),"^"),9)_$J($P(LRPATH,"^",8),4)_$J($P(LRPATH,"^",2),4)
40 . S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)=LRDATA
41 . S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)=" Lab Test Indicator Value"
42LTEST . S LRI=0 F S LRI=$O(^LAB(69.5,LRA,1,LRI)) Q:'LRI D
43 . . S LRTEST=$G(^LAB(69.5,LRA,1,LRI,0))
44 . . I $P(LRTEST,"^")="" S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)="IEN # "_LRA_" damaged. (No Test)" Q
45 . . S LRCOND=$P(LRTEST,"^",2),LRCOND=$S(LRCOND=1:"Ref. Range",LRCOND=2:"Contains",LRCOND=3:"Greater Than",LRCOND=4:"Less Than",LRCOND=5:"Equal To",1:"Unknown")
46 . . S LRDATA=$P($G(^LAB(60,$P(LRTEST,"^"),0),0),"^")_$E(LRFILL,$L($P($G(^LAB(60,$P(LRTEST,"^"),0),0),"^")),40)_$J(LRCOND,20)_$J($P(LRTEST,"^",3),10)
47 . . S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)=LRDATA
48 . S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)=" Etiology"
49ETIO . S LRI=0 F S LRI=$O(^LAB(69.5,LRA,2,LRI)) Q:'LRI D
50 . . S LRTEST=$G(^LAB(69.5,LRA,2,LRI,0))
51 . . I $P(LRTEST,"^")="" S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)="IEN # "_LRA_" damaged. (No Etiology)" Q
52 . . S LRCOND=$P(LRTEST,"^",2),LRCOND=$S(LRCOND=1:"Ref. Range",LRCOND=2:"Contains",LRCOND=3:"Greater Than",LRCOND=4:"Less Than",LRCOND=5:"Equal To",1:"Unknown")
53 . . S LRDATA=$P($G(^LAB(61.2,$P(LRTEST,"^"),0),0),"^")
54 . . S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)=LRDATA
55 . S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)=" ICD9"
56ICD9 . S LRI=0 F S LRI=$O(^LAB(69.5,LRA,3,LRI)) Q:'LRI D
57 . . S LRICD9=$G(^LAB(69.5,LRA,3,LRI,0))
58 . . I $P(LRICD9,"^")="" S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)="IEN # "_LRA_" damaged. (No ICD9)" Q
59 . . S LRDATA=$P($G(^ICD9($P(LRICD9,"^"),0),0),"^")
60 . . S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)=LRDATA
61 . S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)=" Microbial Susceptibility Indicator Value"
62MICROB . S LRI=0 F S LRI=$O(^LAB(69.5,LRA,4,LRI)) Q:'LRI D
63 . . S LRTEST=$G(^LAB(69.5,LRA,4,LRI,0))
64 . . I $P(LRTEST,"^")="" S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)="IEN # "_LRA_" damaged. (No Microbial Susceptibility)" Q
65 . . S LRCOND=$P(LRTEST,"^",2),LRCOND=$S(LRCOND=1:"Contains",LRCOND=2:"Greater Than",LRCOND=3:"Less Than",LRCOND=4:"Equal To",1:"Unknown")
66 . . S LRDATA=" "_$P($G(^LAB(62.06,$P(LRTEST,"^"),0),0),"^")_$E(LRFILL,$L($P($G(^LAB(62.06,$P(LRTEST,"^"),0),0),"^")),33)_$J(LRCOND,20)_$J($P(LRTEST,"^",3),11)
67 . . S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)=LRDATA
68 G EXIT
69OUT S LREPLNT=$G(LREPLNT)+1,^TMP($J,"LREPDATA",LREPLNT)=XMRG_LREPER_LREPST Q
70 ;Build the text for the return message here.
71ZEOR ;LREPISRV
Note: See TracBrowser for help on using the repository browser.