source: FOIAVistA/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMPTD1.m@ 1704

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

initial load of FOIAVistA 6/30/08 version

File size: 2.2 KB
Line 
1PXRMPTD1 ; SLC/PKR/PJH/AGP - Reminder Inquiry print template routines. ;05/04/2006
2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
3 ;
4 ;=======================================
5AFREQ ; Print baseline FREQUENCY/AGE RANGE.
6 N PXAMAX,PXAMIN,PXF,PXF0,PXW
7 S PXF0=$G(^PXD(811.9,D0,7,D1,0))
8 S PXF=$P(PXF0,U,1)
9 S PXAMIN=$P(PXF0,U,2)
10 S PXAMAX=$P(PXF0,U,3)
11 I PXF="" S PXW="MISSING FREQUENCY"
12 S PXW=$$FREQ^PXRMPTD2(PXF)
13 S PXW=PXW_$$FMTAGE^PXRMAGE(PXAMIN,PXAMAX)
14 W " ",PXW
15 Q
16 ;
17 ;=======================================
18DUEWI ;Print DO WITHIN time frame
19 N PXF,PXW
20 S PXF=$P($G(^PXD(811.9,D0,0)),U,4)
21 I (PXF="")!(+PXF=0) W " Wait until actually DUE" Q
22 S PXW=$$FREQ^PXRMPTD2(PXF)
23 W " Do if DUE within "_PXW
24 Q
25 ;
26 ;=======================================
27EDIT ;Print latest entry in edit history
28 N CNT,DIWF,DIWL,DIWR,EDATA,EIEN,ETIME,FIRST,IC,MAX,UIEN,USER,X
29 K ^UTILITY($J,"W")
30 ;Get edit history count
31 S MAX=$G(^PXRM(800,1,"EDIT HISTORY COUNT")) I MAX="" S MAX=2
32 ;Last N lines
33 S CNT=0,EIEN="A",FIRST=1
34 F S EIEN=$O(^PXD(811.9,D0,110,EIEN),-1) Q:'EIEN Q:CNT=MAX D
35 .;Edit date and edit by fields
36 .S EDATA=$G(^PXD(811.9,D0,110,EIEN,0)) Q:EDATA=""
37 .S ETIME=$P(EDATA,U),UIEN=$P(EDATA,U,2) Q:'UIEN
38 .S USER=$$GET1^DIQ(200,UIEN,.01),CNT=CNT+1
39 .;Comments
40 .S DIWF="C50",DIWL=20,DIWR=78
41 .S IC=0
42 .F S IC=$O(^PXD(811.9,D0,110,EIEN,1,IC)) Q:'IC D
43 ..S X=$G(^PXD(811.9,D0,110,EIEN,1,IC,0))
44 ..D ^DIWP
45 .;Output
46 .;Header
47 .I FIRST S FIRST=0 W "Edit History:",!!
48 .W ?4,"Edit date:",?16,$$FMTE^XLFDT(ETIME,"1")
49 .W ?40,"Edit by:",?52,USER
50 .W !,?4,"Edit Comments:"
51 .S IC=0
52 .F S IC=$O(^UTILITY($J,"W",DIWL,IC)) Q:IC="" D
53 ..W ?20,^UTILITY($J,"W",DIWL,IC,0),!
54 .K ^UTILITY($J,"W")
55 .W !!
56 Q
57 ;
58 ;=======================================
59USAGE ;Format usage string
60 W ?7,$$XFORM($P($G(^PXD(811.9,D0,100)),U,4))
61 Q
62 ;
63 ;=======================================
64XFORM(Y) ;Print transform for field 103 in file #811.9
65 ;If ALL
66 I Y["*" Q "CPRS, DATA EXTRACT, REPORTS"
67 ;Otherwise
68 N ARRAY,IC,LIT,OUTPUT,X
69 F IC=1:1:$L(Y) D
70 .S X=$E(Y,IC)
71 .S LIT=$S(X="C":"CPRS",X="X":"DATA EXTRACT",X="R":"REPORTS",X="P":"PATIENT",X="L":"REMINDER PATIENT LIST",1:"")
72 .I LIT'="" S ARRAY(LIT)=""
73 ;
74 S LIT="",OUTPUT=""
75 F S LIT=$O(ARRAY(LIT)) Q:LIT="" D
76 .S OUTPUT=OUTPUT_", "_LIT
77 Q $E(OUTPUT,3,$L(OUTPUT))
78 ;
Note: See TracBrowser for help on using the repository browser.