source: FOIAVistA/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMLPHS.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.0 KB
Line 
1PXRMLPHS ; SLC/PJH,PKR - Run Health Summaries from Patient List ;03/26/2007
2 ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
3 ;
4 ;External Ref DBIA #398
5 ;
6HSA(LISTIEN) ;Run health summary for all patients on this patient list.
7 N HSIEN,PLNODE
8 ;Initialise
9 D FULL^VALM1
10 ;Reset screen mode
11 W IORESET
12 ;
13 ;Select Health Summary
14 D HSEL(.HSIEN) Q:$D(DTOUT)!$D(DUOUT)
15 ;
16 S PLNODE="PXRMLPHS"_$J_$$NOW^XLFDT
17 K ^XTMP(PLNODE)
18 S ^XTMP(PLNODE,0)=$$FMADD^XLFDT(DT,2)_U_DT_"HSI LIST"
19 D SORT(LISTIEN,PLNODE)
20 D QUE(HSIEN,PLNODE)
21 Q
22 ;
23HSEL(IEN) ;Select Health Summary Type
24 N X,Y,DIC
25HS1 S DIC=142,DIC(0)="QAEMZ"
26 S DIC("A")="Select HEALTH SUMMARY TYPE: "
27 W !
28 D ^DIC
29 I X="" W !,"A health summary type name must be entered" G HS1
30 I X=(U_U) S DTOUT=1
31 I Y=-1 S DUOUT=1
32 I $D(DTOUT)!$D(DUOUT) Q
33 ;Return HS ien
34 S IEN=$P(Y,U)
35 Q
36 ;
37HSI(PLNODE) ;Print health summary for selected patients.
38 N HSIEN
39 ;Initialise
40 D FULL^VALM1
41 ;Reset screen mode
42 W IORESET
43 ;
44 ;Select Health Summary
45 D HSEL(.HSIEN) Q:$D(DTOUT)!$D(DUOUT)
46 D QUE(HSIEN,PLNODE)
47 Q
48 ;
49PRINT(HSIEN,PLNODE) ;Print HS for Patient List IEN
50 N DFN,DIROUT,SUB
51 ;Print HS for each patient
52 S SUB=0
53 F S SUB=$O(^XTMP(PLNODE,SUB)) Q:(SUB="")!$D(DIROUT) D
54 .S DFN=^XTMP(PLNODE,SUB)
55 .D ENX^GMTSDVR(DFN,HSIEN,"","") ; DBIA #398
56 ;
57 ;Clear workfile
58 K ^XTMP(PLNODE)
59 Q
60 ;
61QUE(HSIEN,PLNODE) ;Determine whether the report should be queued.
62 N PXRMQUE,%ZIS,ZTDESC,ZTRTN,ZTSK,ZTSAVE
63 S %ZIS="M"
64 S ZTDESC="Patient List Health Summaries - print"
65 S ZTRTN="PRINT^PXRMLPHS(HSIEN,PLNODE)"
66 S ZTSAVE("HSIEN")=""
67 S ZTSAVE("PLNODE")=""
68 S PXRMQUE=$$DEVICE^PXRMXQUE(ZTRTN,ZTDESC,.ZTSAVE,.%ZIS,1)
69 S VALMBCK="R"
70 Q
71 ;
72SORT(LISTIEN,PLNODE) ;Sort workfile as required
73 N DATA,DFN,IND,PNAME
74 ;Build the list in alphabetical order.
75 S IND=0
76 F S IND=$O(^PXRMXP(810.5,LISTIEN,30,IND)) Q:'IND D
77 .S DATA=$G(^PXRMXP(810.5,LISTIEN,30,IND,0)) Q:DATA=""
78 .S DFN=$P(DATA,U) Q:'DFN
79 .;DBIA #10035
80 .S PNAME=$P(^DPT(DFN,0),U,1) Q:PNAME=""
81 .S ^XTMP(PLNODE,PNAME)=DFN
82 Q
83 ;
Note: See TracBrowser for help on using the repository browser.