source: FOIAVistA/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMAPI1.m@ 792

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

initial load of FOIAVistA 6/30/08 version

File size: 2.5 KB
Line 
1PXRMAPI1 ; SLC/PJH - Reminder Package API's;02/27/2002
2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
3 ;
4 ;Return ARRAY ; DBIA #3333
5 ;------------------------
6PLIST(ORY) ;Build a list of patient list entries.
7 N CNT,PATCNT,DATE,IND,FULL,NAME
8 ;Build the list in alphabetical order.
9 S CNT=0
10 S NAME=""
11 F S NAME=$O(^PXRMXP(810.5,"B",NAME)) Q:NAME="" D
12 .S IND=$O(^PXRMXP(810.5,"B",NAME,"")) Q:'IND
13 .S FULL=$P($G(^PXRMXP(810.5,IND,0)),U)
14 .S DATE=$P($G(^PXRMXP(810.5,IND,0)),U,4)
15 .S PATCNT=+$P($G(^PXRMXP(810.5,IND,30,0)),U,4),CNT=CNT+1
16 .S ORY(CNT)=IND_U_FULL_U_$$FMTE^XLFDT(DATE,"5Z")_U_PATCNT
17 I CNT=0 S ORY(1)="-1^no entries found"
18 Q
19 ;
20PLISTP(ORY,IEN) ;Build a list of patient list patients
21 N CNT,DATA,DFN,PNAME,IND,STATION,VADM,VAERR
22 ;Build the list in alphabetical order.
23 S IND=0,CNT=0
24 F S IND=$O(^PXRMXP(810.5,IEN,30,IND)) Q:'IND D
25 .S DATA=$G(^PXRMXP(810.5,IEN,30,IND,0)) Q:DATA=""
26 .S DFN=$P(DATA,U) Q:'DFN
27 .D DEM^VADPT S PNAME=$G(VADM(1))
28 .S STATION=$P(DATA,U,2)
29 .S CNT=CNT+1,ORY(CNT)=DFN_U_PNAME_U_STATION
30 I CNT=0 S ORY(1)="-1^no entries found"
31 Q
32 ;
33EPLIST(ORY) ;Build a list of extract parameter entries.
34 N CNT,DATE,IND,FULL,NAME,TRANSMIT
35 ;Build the list in alphabetical order.
36 S CNT=0
37 S NAME=""
38 F S NAME=$O(^PXRM(810.2,"B",NAME)) Q:NAME="" D
39 .S IND=$O(^PXRM(810.2,"B",NAME,"")) Q:'IND
40 .S FULL=$P($G(^PXRM(810.2,IND,0)),U)
41 .S DATE=$P($G(^PXRM(810.2,IND,0)),U,4)
42 .S TRANSMIT=""
43 .S CNT=CNT+1,ORY(CNT)=IND_U_FULL_U_DATE_U_TRANSMIT
44 I CNT=0 S ORY(1)="-1^no entries found"
45 Q
46 ;
47EHLIST(ORY,IEN) ;Build a list of extract summary entries.
48 N CNT,IND,NAME,PERIOD,YEAR
49 ;Build the list in alphabetical order.
50 S YEAR="9999",CNT=0
51 F S YEAR=$O(^PXRMXT(810.3,"D",IEN,YEAR),-1) Q:'YEAR D
52 .S PERIOD=""
53 .F S PERIOD=$O(^PXRMXT(810.3,"D",IEN,YEAR,PERIOD)) Q:'PERIOD D
54 ..S IND=""
55 ..F S IND=$O(^PXRMXT(810.3,"D",IEN,YEAR,PERIOD,IND)) Q:'IND D
56 ...S NAME=$P($G(^PXRMXT(810.3,IND,0)),U) Q:NAME=""
57 ...S CNT=CNT+1,ORY(CNT)=IND_U_NAME
58 I CNT=0 S ORY(1)="-1^no entries found"
59 Q
60 ;
61ETLIST(ORY,IEN) ;Build a list of extract summary totals.
62 N APPL,CNT,DATA,DUE,IND,RIEN,RNAME,SNAME,STATION,TOT
63 ;Build the list in alphabetical order.
64 S IND=0,CNT=0
65 F S IND=$O(^PXRMXT(810.3,IEN,3,IND)) Q:'IND D
66 .S DATA=$G(^PXRMXT(810.3,IEN,3,IND,0)) Q:DATA=""
67 .S RIEN=$P(DATA,U,2) Q:'RIEN
68 .S RNAME=$P($G(^PXD(811.9,RIEN,0)),U)
69 .S STATION=$P(DATA,U,3),SNAME=STATION
70 .S TOT=+$P(DATA,U,5),APPL=+$P(DATA,U,6),DUE=$P(DATA,U,8)
71 .S CNT=CNT+1,ORY(CNT)=RNAME_U_SNAME_U_TOT_U_APPL_U_DUE
72 I CNT=0 S ORY(1)="-1^no entries found"
73 Q
Note: See TracBrowser for help on using the repository browser.