source: FOIAVistA/trunk/r/CLINICAL_REMINDERS-PXRM/PXRM7API.m@ 1751

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

initial load of FOIAVistA 6/30/08 version

File size: 1.8 KB
Line 
1PXRM7API ;SLC/JVS Clinical Reminders HL7 API; 09/21/2006
2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
3 ;This is the beginning of the HL7 API's
4 ;
5 ;VARIABLE LIST
6 ;IEN = IEN OF ENTRY IN EXTRACT FILE 810.3
7 Q
8 ;======================================================
9HL7(IEN,SEE,ID) ;AllRequiredParameters
10 ;IEN= The Ien of the entry in file 810.3 (Extract File)
11 ;SEE=If you want to view the HL7 message, set to 1
12 ;.ID= ID of the message.
13 ;MODE=A or I A=from archive I=initial Load
14 D EXTRACT^PXRM7XT(IEN,SEE,.ID)
15 Q
16 ;=======================================================
17STATUS(ID) ;
18 ;RETURNS THE STATUS OF THE MESSAGE
19 ;ID= MESSAGE ID WHICH IS THE IEN IN FILE #772
20 D STORE
21 N IEND0,IEND1,STATUS
22 S STATUS=""
23 Q:'$D(^PXRMXT(810.3,"AHLID"))
24 S IEND0=$O(^PXRMXT(810.3,"AHLID",ID,0))
25 S IEND1=$O(^PXRMXT(810.3,"AHLID",ID,IEND0,0))
26 S STATUS=$P($G(^PXRMXT(810.3,IEND0,5,IEND1,0)),"^",3)
27 Q STATUS
28 ;=======================================================
29STATUS2(ID) ;
30 ;RETURNS THE STATUS OF THE MESSAGE
31 ;ID= MESSAGE ID WHICH IS THE IEN IN FILE #772
32 N IDD,ID1,ID2,STATUS
33 S STATUS=""
34 S ID1=$O(^HL(772,"C",ID,0))
35 S ID2=$O(^HL(772,"C",ID,ID1))
36 D GETS^DIQ(772,ID2,20,"E","STATUS")
37 S IDD=ID2_","
38 S STATUS=$G(STATUS(772,IDD,20,"E"))
39 Q STATUS
40 ;======================================================
41STORE ;
42 N IEND0,IEND1,HL7ID,STATHL,STATX
43 S HL7ID=""
44 S IEND0=0 F S IEND0=$O(^PXRMXT(810.3,IEND0)) Q:IEND0="" D
45 .S IEND1=0 F S IEND1=$O(^PXRMXT(810.3,IEND0,5,IEND1)) Q:IEND1="" D
46 ..S HL7ID=$P($G(^PXRMXT(810.3,IEND0,5,IEND1,0)),"^",1)
47 ..Q:HL7ID=""
48 ..S STATHL=$$STATUS2^PXRM7API(HL7ID)
49 ..S STATX=$P(^PXRMXT(810.3,IEND0,5,IEND1,0),"^",3)
50 ..I STATHL'="" D
51 ...S $P(^PXRMXT(810.3,IEND0,5,IEND1,0),"^",3)=STATHL
52 ..I STATHL="",STATX="" D
53 ...S $P(^PXRMXT(810.3,IEND0,5,IEND1,0),"^",3)="Successfully Completed"
54 Q
55 ;
Note: See TracBrowser for help on using the repository browser.