source: WorldVistAEHR/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMETH1.m@ 1311

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

revised back to 6/30/08 version

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