source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/VAFHUTL9.m@ 686

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

initial load of WorldVistAEHR

File size: 1.2 KB
RevLine 
[613]1VAFHUTL9 ;ALB/RJS - UTILTIES FOR ADT/R HL7 INTERFACE - 6/15/95
2 ;;5.3;Registration;**91**;Jun 06, 1996
3 ;
4 ;This Routine contains several utilities used by the PIMS
5 ;HL7 ADT software
6 ;
7SEG(SEGMENT,PIECE,CODE) ;Return segment from VADC array and kill node
8 N VANODE,VADATA,VADONE K VADONE
9 S VANODE=0
10 F S VANODE=$O(VADC(VANODE)) Q:VANODE=""!($D(VADONE)) D
11 .S VADATA=VADC(VANODE)
12 .I ($P(VADATA,HLFS,1)=SEGMENT)&($P($P(VADATA,HLFS,PIECE),VAC,1)=CODE) S VADONE=1 K VADC(VANODE)
13 Q:$D(VADONE) $G(VADATA)
14 Q ""
15SEG1(SEGMENT,PIECE,CODE) ;Return segment from VADC array
16 N VANODE,VADATA,VADONE K VADONE
17 S VANODE=0
18 F S VANODE=$O(VADC(VANODE)) Q:VANODE=""!($D(VADONE)) D
19 .S VADATA=VADC(VANODE)
20 .I ($P(VADATA,HLFS,1)=SEGMENT) S VADONE=1
21 Q:$D(VADONE) $G(VADATA)
22 Q ""
23INITIZE(HLDA) ;Initialize VADC array with incoming message
24 N VANODE S VANODE=0
25 F S VANODE=$O(^HL(772,HLDA,"IN",VANODE)) Q:VANODE'>0 D
26 .S VADC(VANODE)=^HL(772,HLDA,"IN",VANODE,0)
27 Q
28INIT1 ;
29 F I=1:1 X HLNEXT Q:HLQUIT'>0 S X(I)=HLNODE MERGE X(I)=HLNODE
30 MERGE VADC=X
31 Q
32SSNDFN(SSN) ;Input ssn output DFN
33 Q:$G(SSN)="" -1
34 S DFN=$O(^DPT("SSN",+SSN,0))
35 Q:$L(DFN) DFN
36 S DFN=$O(^DPT("SSN",SSN,0))
37 Q:$L(DFN) DFN
38 Q -1
Note: See TracBrowser for help on using the repository browser.