source: WorldVistAEHR/trunk/r/HEALTH_LEVEL_SEVEN-HL/HLOCVU.m@ 1365

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

initial load of WorldVistAEHR

File size: 3.4 KB
RevLine 
[613]1HLOCVU ;DAOU/ALA-Conversion Utility ;03/15/2007
2 ;;1.6;HEALTH LEVEL SEVEN;**126,132,134**;Oct 13, 1995;Build 30
3 ;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5 Q
6 ;
7APAR(HLOEID,APARMS,WHO,WHOTO,HLP,HLL) ; Set up PPARMS array from Protocols
8 ;
9 ; Input Parameter
10 ; HLOEID = IEN of the event protocol
11 ; HLP - "EXCLUDE SUBSCRIBER" subscript used to ignore specific subscribers
12 ; HLL - dynamic addressing
13 ;
14 ; Output
15 ; APARMS array
16 ; WHO - correlates to WHOTO, providing <subscriber protocol ien>,<link ien> (pass by reference)
17 ; WHOTO array
18 ;
19 N CT,NODE,I
20 K APARMS,WHO,WHOTO
21 S CT=0
22 Q:'$G(HLOEID)
23 S NODE=$G(^ORD(101,HLOEID,770))
24 S APARMS("EVENT")=$P(NODE,"^",4),APARMS("EVENT")=$S(APARMS("EVENT"):$P($G(^HL(779.001,APARMS("EVENT"),0)),"^"),1:"")
25 S APARMS("MESSAGE TYPE")=$P(NODE,"^",3),APARMS("MESSAGE TYPE")=$S(APARMS("MESSAGE TYPE"):$P($G(^HL(771.2,APARMS("MESSAGE TYPE"),0)),"^"),1:"")
26 S APARMS("APP ACK TYPE")=$P(NODE,"^",9),APARMS("APP ACK TYPE")=$S(APARMS("APP ACK TYPE"):$P($G(^HL(779.003,APARMS("APP ACK TYPE"),0)),"^"),1:"")
27 S APARMS("ACCEPT ACK TYPE")=$P(NODE,"^",8),APARMS("ACCEPT ACK TYPE")=$S(APARMS("ACCEPT ACK TYPE"):$P($G(^HL(779.003,APARMS("ACCEPT ACK TYPE"),0)),"^"),1:"")
28 S APARMS("VERSION")=$P(NODE,"^",10),APARMS("VERSION")=$S(APARMS("VERSION"):$P($G(^HL(771.5,APARMS("VERSION"),0)),"^"),1:"")
29 S APARMS("SENDING APPLICATION")=$P(NODE,"^")
30 I APARMS("SENDING APPLICATION") D
31 .S APARMS("FIELD SEPARATOR")=$E($G(^HL(771,APARMS("SENDING APPLICATION"),"FS")),1)
32 .S:APARMS("FIELD SEPARATOR")="" APARMS("FIELD SEPARATOR")="^"
33 .S APARMS("ENCODING CHARACTERS")=$E($G(^HL(771,APARMS("SENDING APPLICATION"),"EC")),1,4)
34 .S:APARMS("ENCODING CHARACTERS")="" APARMS("ENCODING CHARACTERS")="~|\&"
35 .S APARMS("SENDING APPLICATION")=$P($G(^HL(771,APARMS("SENDING APPLICATION"),0)),"^")
36 .I APARMS("SENDING APPLICATION")'="",'$O(^HLD(779.2,"C",APARMS("SENDING APPLICATION"),0)) D
37 ..;add the sending applcation to the registry
38 ..N DATA,ERROR
39 ..S DATA(.01)=APARMS("SENDING APPLICATION")
40 ..S DATA(2)=$P($G(^ORD(101,HLOEID,0)),"^",12)
41 ..I $$ADD^HLOASUB1(779.2,,.DATA,.ERROR) ;then will not generate an error
42 E D
43 .S APARMS("SENDING APPLICATION")=""
44 .S APARMS("FIELD SEPARATOR")="^"
45 .S APARMS("ENCODING CHARACTERS")="~|\&"
46 ;
47 S APARMS("COUNTRY")="USA"
48 ;
49 ;get the subscribers
50 D
51 .N SUBIEN,HLOSID
52 .S SUBIEN=0
53 .F S SUBIEN=$O(^ORD(101,HLOEID,775,SUBIEN)) Q:'SUBIEN D
54 ..N NODE,APP,LINK,EXCLUDE
55 ..S NODE=$G(^ORD(101,HLOEID,775,SUBIEN,0))
56 ..S HLOSID=$P(NODE,"^")
57 ..Q:'HLOSID
58 ..S NODE=$G(^ORD(101,HLOSID,770))
59 ..S APP=$P(NODE,"^",2)
60 ..Q:'APP
61 ..S LINK=$P(NODE,"^",7)
62 ..Q:'LINK
63 ..;
64 ..;excluded?
65 ..S (EXCLUDE,I)=0
66 ..F S I=$O(HLP("EXCLUDE SUBSCRIBER",I)) Q:'I I $G(HLP("EXCLUDE SUBSCRIBER",I))=HLOSID S EXCLUDE=1 Q
67 ..Q:EXCLUDE
68 ..;
69 ..S CT=CT+1
70 ..S WHO(CT)=HLOSID_"^"_LINK
71 ..S WHOTO(CT,"RECEIVING APPLICATION")=$P($G(^HL(771,APP,0)),"^")
72 ..S WHOTO(CT,"FACILITY LINK NAME")=$P($G(^HLCS(870,LINK,0)),"^")
73 ;
74 S I=0
75 F S I=$O(HLL("LINKS",I)) Q:'I D
76 .N LINK,PROTOCOL
77 .S CT=CT+1
78 .S PROTOCOL=$P(HLL("LINKS",I),"^")
79 .S LINK=$P(HLL("LINKS",I),"^",2)
80 .I PROTOCOL=+PROTOCOL D
81 ..S WHO(CT)=PROTOCOL
82 ..S PROTOCOL=$P($G(^ORD(101,PROTOCOL,0)),"^")
83 .E D
84 ..S WHO(CT)=$O(^ORD(101,"B",PROTOCOL,0))
85 .I LINK=+LINK D
86 ..S $P(WHO(CT),"^",2)=LINK
87 ..S LINK=$P($G(^HLCS(870,LINK,0)),"^")
88 .E D
89 ..S $P(WHO(CT),"^",2)=$O(^HLCS(870,"B",LINK,0))
90 .S WHOTO(CT,"RECEIVING APPLICATION")=PROTOCOL
91 .S WHOTO(CT,"FACILITY LINK NAME")=LINK
92 Q
Note: See TracBrowser for help on using the repository browser.