source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LR7OGMP.m@ 949

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

initial load of WorldVistAEHR

File size: 3.3 KB
Line 
1LR7OGMP ;DALOI/STAFF- Interim report rpc memo print ;10/10/07 11:52
2 ;;5.2;LAB SERVICE;**187,246,282,286,344**;Sep 27, 1994;Build 2
3 ;
4PRINT(OUTCNT) ; from LR7OGMC
5 N ACC,AGE,CDT,CMNT,DATA,DOC,FLAG,HIGH,IDT,INTP,LINE,LOW,LRCW,LRX,PORDER,PRNTCODE,RANGE,REFHIGH,REFLOW,SEX,SITE,SPEC,SUB,TESTNUM
6 N TESTSPEC,THER,THERHIGH,THERLOW,UNITS,VALUE,X,ZERO
7 ; the variables AGE, SEX, LRCW, and X are used withing the lab's print codes and ref ranges
8 S AGE=$P(^TMP("LR7OG",$J,"G"),U,4),SEX=$P(^("G"),U,5),LRCW=$P(^("G"),U,6)
9 S CDT=0
10 F S CDT=$O(^TMP("LR7OG",$J,"TP",CDT)) Q:CDT="" D
11 . S IDT=9999999-CDT
12 . S ZERO=$S($D(^TMP("LR7OG",$J,"TP",CDT))#2:^(CDT),1:"")
13 . I '$P(ZERO,U,3) Q
14 . S SPEC=+$P(ZERO,U,5)
15 . S DOC=$$NAME(+$P(ZERO,U,10))
16 . D SETLINE("",.OUTCNT)
17 . D SETLINE("Provider : "_DOC,.OUTCNT)
18 . S LINE=" Specimen: "_$P(^LAB(61,SPEC,0),U)_"."
19 . S ACC=$P(ZERO,U,6)
20 . S LINE=$$SETSTR^VALM1(" "_ACC,LINE,30,1+$L(ACC))
21 . D SETLINE(LINE,.OUTCNT)
22 . D SETLINE(" "_$$DD(CDT),.OUTCNT)
23 . D SETLINE(" Test name Result units Ref. range Site Code",.OUTCNT)
24 . S PORDER=0
25 . F S PORDER=$O(^TMP("LR7OG",$J,"TP",CDT,PORDER)) Q:PORDER'>0 S DATA=^(PORDER) D
26 .. I $P(DATA,U,7)="" Q
27 .. S TESTNUM=+DATA,PRNTCODE=$P(DATA,U,5),SUB=$P(DATA,U,6),FLAG=$P(DATA,U,8),X=$P(DATA,U,7),UNITS=$P(DATA,U,9),RANGE=$P(DATA,U,10),SITE=$P(DATA,U,11)
28 .. S LOW=$P(RANGE,"-"),HIGH=$P(RANGE,"-",2),THER=$P(DATA,U,12)
29 .. ;S LINE=" "_$S($L($P(DATA,U,2))>20:$P(DATA,U,3),1:$P(DATA,U,2))
30 .. I $L($P(DATA,U,2))>28,$P(DATA,U,3)'="" S LINE=$P(DATA,U,3)
31 .. E S LINE=$E($P(DATA,U,2),1,28)
32 .. S LINE=$$SETSTR^VALM1("",LINE,28,0)
33 .. I PRNTCODE="" S LINE=LINE_$J(X,8)
34 .. E S @("VALUE="_PRNTCODE),LINE=LINE_VALUE
35 .. S LINE=LINE_" "_FLAG
36 .. I $L(LINE)>38 D SETLINE(LINE,.OUTCNT) S LINE=""
37 .. I UNITS'="" S LINE=$$SETSTR^VALM1(" "_UNITS,LINE,39,2+$L(UNITS))
38 .. S LRX=RANGE
39 .. I LRX'="" S LINE=$$SETSTR^VALM1(LRX,LINE,52,$L(LRX))
40 .. I $L(LINE)>67,SITE D SETLINE(LINE,.OUTCNT) S LINE=""
41 .. I SITE S LINE=$$SETSTR^VALM1(" ["_SITE_"]",LINE,68,3+$L(SITE))
42 .. I LINE'="" D SETLINE(LINE,.OUTCNT)
43 .. I $O(^TMP("LR7OG",$J,"TP",CDT,PORDER,0))>0 D
44 ... S INTP=0
45 ... F S INTP=+$O(^TMP("LR7OG",$J,"TP",CDT,PORDER,INTP)) Q:INTP<1 D SETLINE(" Eval: "_^(INTP),.OUTCNT)
46 . I $D(^TMP("LR7OG",$J,"TP",CDT,"C")) D
47 .. S LINE="Comment: "
48 .. S CMNT=0
49 .. F S CMNT=+$O(^TMP("LR7OG",$J,"TP",CDT,"C",CMNT)) Q:CMNT<1 S LINE=LINE_^(CMNT) D
50 ... D SETLINE(LINE,.OUTCNT)
51 ... I $O(^TMP("LR7OG",$J,"TP",CDT,"C",CMNT)) S LINE=" "
52 . D SETLINE("===============================================================================",.OUTCNT)
53 Q
54 ;
55 ;
56SETLINE(LINE,CNT) ;
57 S ^TMP("LR7OGX",$J,"OUTPUT",CNT)=LINE
58 S CNT=CNT+1
59 Q
60 ;
61 ;
62NAME(X) ; $$(#) -> name
63 N LRDOC
64 D DOC^LRX
65 Q LRDOC
66 ;
67 ;
68DD(Y) ; $$(date/time) -> date/time format
69 D DD^LRX
70 Q Y
71 ;
72 ;
73PLS ; List performing laboratories
74 ;
75 N LINE,LRPLS,X
76 D SETLINE("Performing Lab Sites",.OUTCNT)
77 S LRPLS=0
78 F S LRPLS=$O(^TMP("LRPLS",$J,LRPLS)) Q:LRPLS<1 D
79 . S LINE=$$LJ^XLFSTR("["_LRPLS_"] ",8)_$$NAME^XUAF4(LRPLS)
80 . D SETLINE(LINE,.OUTCNT)
81 . S X=$$PADD^XUAF4(LRPLS)
82 . S LINE=$$REPEAT^XLFSTR(" ",8)_$P(X,U)_" "_$P(X,U,2)_", "_$P(X,U,3)_" "_$P(X,U,4)
83 . D SETLINE(LINE,.OUTCNT)
84 ;
85 D SETLINE("===============================================================================",.OUTCNT)
86 ;
87 K ^TMP("LRPLS",$J)
88 Q
Note: See TracBrowser for help on using the repository browser.