source: FOIAVistA/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMETH1.m@ 767

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

initial load of FOIAVistA 6/30/08 version

File size: 3.4 KB
Line 
1PXRMETH1 ; SLC/PJH - Reminder Extract History ;09/07/2007
2 ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
3 ;
4BLDLIST(EDIEN) ;Build workfile
5 ;EDIEN is the extract definition IEN.
6 N IND,FMTSTR,PLIST
7 K ^TMP("PXRMETH",$J)
8 S FMTSTR=$$LMFMTSTR^PXRMTEXT(.VALMDDF,"RLL")
9 ;Build list of extract summaries in period order
10 I PXRMVIEW="P" D LIST1(EDIEN,"PXRMETH",FMTSTR)
11 ;Build list of extract summaries in date order
12 I PXRMVIEW="D" D LIST2(EDIEN,"PXRMETH",FMTSTR)
13 Q
14 ;
15FMT(NUMBER,NAME,EDATE,XDATE,AUTO,FMTSTR,NL,OUTPUT) ;Format
16 N TAUTO,TDATE,TEMP,TNAME,TSOURCE
17 S TEMP=NUMBER_U_NAME_U
18 S TDATE=$$FMTE^XLFDT(EDATE,"5Z")
19 S TEMP=TEMP_$$LJ^XLFSTR(TDATE,20," ")
20 S TDATE=XDATE I TDATE S TDATE=$$FMTE^XLFDT(TDATE,"5Z")
21 S TEMP=TEMP_" "_$$LJ^XLFSTR(TDATE,22," ")
22 S TAUTO=AUTO
23 S TEMP=TEMP_TAUTO
24 D COLFMT^PXRMTEXT(FMTSTR,TEMP," ",.NL,.OUTPUT)
25 Q
26 ;
27HELP(CALL) ;General help text routine.
28 N HTEXT
29 I CALL=1 D
30 .S HTEXT(1)="Select DE to delete an extract.\\"
31 .S HTEXT(2)="Select ES to view the details of an extract or run a compliance"
32 .S HTEXT(3)="report for the extract.\\Select MT to transmit extract details to the AAC.\\"
33 .S HTEXT(4)="Select TH to view the transmission history for an extract."
34 ;
35 I CALL=3 D
36 .S HTEXT(1)="Select Y to send the results of the Extract to the National Austin database."
37 ;
38 I CALL=4 D
39 .S HTEXT(4)="Select Y to overwrite the previous Extract stored in the National Austin Database."
40 D HELP^PXRMEUT(.HTEXT)
41 Q
42 ;
43LIST1(EDIEN,NODE,FMTSTR) ;Build a list of extract summaries for a parameter.
44 N AUTO,EDATE,HL7ID,HL7SUB,IND,JND,NAME,NL,NUM,OUTPUT
45 N PERIOD,STR,XDATE,YEAR
46 ;Build list of extract summaries in reverse date order.
47 S YEAR="9999",(NUM,VALMCNT)=0
48 F S YEAR=$O(^PXRMXT(810.3,"D",EDIEN,YEAR),-1) Q:YEAR="" D
49 .S PERIOD="99"
50 .F S PERIOD=$O(^PXRMXT(810.3,"D",EDIEN,YEAR,PERIOD),-1) Q:PERIOD="" D
51 ..S IND=""
52 ..F S IND=$O(^PXRMXT(810.3,"D",EDIEN,YEAR,PERIOD,IND),-1) Q:IND="" D
53 ...S NAME=$P($G(^PXRMXT(810.3,IND,0)),U)
54 ...S EDATE=$P($G(^PXRMXT(810.3,IND,0)),U,6)
55 ...S AUTO=$P($G(^PXRMXT(810.3,IND,4)),U,5)
56 ...S AUTO=$S(AUTO="A":"Y",1:"N")
57 ...S HL7ID=$O(^PXRMXT(810.3,IND,5,"B",""),-1),XDATE="",HL7SUB=""
58 ...I HL7ID S HL7SUB=$O(^PXRMXT(810.3,IND,5,"B",HL7ID,""))
59 ...I HL7SUB S XDATE=$P($G(^PXRMXT(810.3,IND,5,HL7SUB,0)),U,2)
60 ...I 'XDATE S XDATE="Not Transmitted"
61 ...S NUM=NUM+1
62 ...D FMT(NUM,NAME,EDATE,XDATE,AUTO,FMTSTR,.NL,.OUTPUT)
63 ...F JND=1:1:NL D
64 ....S VALMCNT=VALMCNT+1,^TMP(NODE,$J,VALMCNT,0)=OUTPUT(JND)
65 ....S ^TMP(NODE,$J,"IDX",VALMCNT,NUM)=""
66 ....S ^TMP(NODE,$J,"SEL",NUM)=IND
67 Q
68 ;
69LIST2(EDIEN,NODE,FMTSTR) ;Build a list of extract summaries for a parameter.
70 N AUTO,EDATE,HL7ID,HL7SUB,IND,JND,NAME,NL,NUM,OUTPUT
71 N PERIOD,STR,XDATE,YEAR
72 ;Build list of extract summaries in reverse date order.
73 S EDATE="",(NUM,VALMCNT)=0
74 F S EDATE=$O(^PXRMXT(810.3,"C",EDIEN,EDATE),-1) Q:'EDATE D
75 .S IND=""
76 .F S IND=$O(^PXRMXT(810.3,"C",EDIEN,EDATE,IND)) Q:'IND D
77 ..S NAME=$P($G(^PXRMXT(810.3,IND,0)),U,1)
78 ..S AUTO=$P($G(^PXRMXT(810.3,IND,4)),U,5)
79 ..S AUTO=$S(AUTO="A":"Y",1:"N")
80 ..S HL7ID=$O(^PXRMXT(810.3,IND,5,"B",""),-1),XDATE="",HL7SUB=""
81 ..I HL7ID S HL7SUB=$O(^PXRMXT(810.3,IND,5,"B",HL7ID,""))
82 ..I HL7SUB S XDATE=$P($G(^PXRMXT(810.3,IND,5,HL7SUB,0)),U,2)
83 ..I 'XDATE S XDATE="Not Transmitted"
84 ..S NUM=NUM+1
85 ..D FMT(NUM,NAME,EDATE,XDATE,AUTO,FMTSTR,.NL,.OUTPUT)
86 ..F JND=1:1:NL D
87 ...S VALMCNT=VALMCNT+1,^TMP(NODE,$J,VALMCNT,0)=OUTPUT(JND)
88 ...S ^TMP(NODE,$J,"IDX",VALMCNT,NUM)=""
89 ...S ^TMP(NODE,$J,"SEL",NUM)=IND
90 Q
91 ;
Note: See TracBrowser for help on using the repository browser.