source: WorldVistAEHR/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LA7UIO.m@ 701

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1LA7UIO ;DALOI/JMC - Process Download Message for #62.48;May 21, 2008
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;**66**;Sep 27, 1994;Build 30
3 ;
4 Q
5 ;
6EN ; Called from LA7UID
7 ; Converts the information for each test in the load list
8 ; into HL7 messages and hands them to the HL7 package for delivery.
9 ; LRLL= IEN in 68.2 Load Worklist file, from field in 62.4
10 ; LRINST= IEN IN 62.4 Auto Inst file
11 ; LRAUTO= zero node of 62.4 entry
12 ; LA76248= IEN in 62.48 Message Parameter file
13 ;
14 N LA76281,LA7,LA7CUP,LA7CUP1,LA7TRAY,LA7TRAY1
15 ;
16 ; Preparing automatic download.
17 I $G(LA7ADL) D ADL Q
18 ;
19 S LA7=^LRO(68.2,LRLL,2)
20 S LA7TRAY=$P(LA7,"^",2),LA7TRAY1=$P(LA7,"^",4)
21 S LA7CUP=$P(LA7,"^",3),LA7CUP1=$P(LA7,"^",5)
22 S:$G(LRTRAY1) LA7TRAY=LRTRAY1
23 S:$G(LRCUP1) LA7CUP=LRCUP1
24 ;
25 ; Process each tray on load list
26 S LA76821=LA7TRAY-1
27 F S LA76821=$O(^LRO(68.2,LRLL,1,LA76821)) Q:'LA76821!(LA76821>LA7TRAY1) D
28 . I '$D(ZTQUEUED) D
29 . . W !!,"Building download record for:"
30 . . I LRTYPE W " Tray: ",LA76821,!,"Cup: "
31 . . E W !,"Seq: "
32 . D CUP
33 D EXIT
34 Q
35 ;
36 ;
37CUP ; Process each cup on load list
38 N LA76822,LA7QUIT
39 ;
40 S LA76822=LA7CUP-1,LA7QUIT=0
41 F S LA76822=$O(^LRO(68.2,LRLL,1,LA76821,1,LA76822)) Q:'LA76822 D Q:LA7QUIT
42 . I LA76821=LA7TRAY1,LA76822>LA7CUP1 S LA7QUIT=1 Q
43 . ; Kill array of tests for this accession
44 . K LA76249,LA7ACC
45 . S LA7ACC=^LRO(68.2,LRLL,1,LA76821,1,LA76822,0)
46 . ; Not requested loadlist profile.
47 . I 'LRPROF,($P(LRPROF,"^",2)'=$P(LA7ACC,"^",4)) Q
48 . ;
49 . S LRAA=+LA7ACC,LRAD=$P(LA7ACC,"^",2),LRAN=$P(LA7ACC,"^",3)
50 . S LA768=LRAA,LA76801=LRAD,LA76802=LRAN
51 . S LA7ACC0=$G(^LRO(68,LRAA,1,LRAD,1,LRAN,0),0)
52 . ; Accession has been removed, skip.
53 . I 'LA7ACC0 D Q
54 . . D CREATE^LA7LOG(24)
55 . ;
56 . D TEST
57 . S LA7INST=LRINST D CHKTEST^LA7ADL
58 . N LA7QUIT
59 . I $O(LA7ACC(0)) D BUILD^LA7UIO1
60 Q
61 ;
62 ;
63TEST ;
64 N LA7TST
65 ;
66 K LA7TREE
67 ;
68 S LA7TST=0
69 F S LA7TST=$O(^LRO(68.2,LRLL,1,LA76821,1,LA76822,1,LA7TST)) Q:'LA7TST D
70 . N LA7X,LA7PCNT
71 . S LA7X=$G(^LRO(68.2,LRLL,1,LA76821,1,LA76822,1,LA7TST,0))
72 . S LA7PCNT=0
73 . D UNWIND^LA7ADL1(+LA7X,$P(LA7X,"^",2),0)
74 Q
75 ;
76 ;
77ADL ; Process/build messages for automatic download, no loadlist.
78 ; Called from above by LA7ADL.
79 ;
80 S LRLL=0,LRAUTO=LA7AUTO(LA7INST)
81 ; Set tray/cup to null.
82 S (LA76821,LA76822)=""
83 ;
84 S LA768=LRAA,LA76801=LRAD,LA76802=LRAN
85 ; Zeroth node of accession.
86 ; Log error if accession has been removed, skip
87 S LA7ACC0=$G(^LRO(68,LA768,1,LA76801,1,LA76802,0),0)
88 I 'LA7ACC0 D Q
89 . D CREATE^LA7LOG(24)
90 ;
91 D BUILD^LA7UIO1
92 D EXIT
93 K LRAUTO,LRINST,LRLL
94 Q
95 ;
96EXIT ;
97 D KVAR^LRX
98 K LA7,LA71,LA76249,LA768,LA76801,LA76802,LA76821,LA76822,LA7ACC,LA7ACC0
99 K LA7CNT,LA7CODE,LA7DATA,LA7DTIM,LA7MSH,LA7NVAF,LA7OBR,LA7ORC,LA7PID,LA7PIDSN,LA7PV1,LA7TMP,LRINFW
100 ;
101 Q
Note: See TracBrowser for help on using the repository browser.