source: WorldVistAEHR/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMLPHS.m@ 724

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

revised back to 6/30/08 version

File size: 2.0 KB
RevLine 
[623]1PXRMLPHS ; SLC/PJH,PKR - Run Health Summaries from Patient List ;08/08/2005
2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
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,RETZTSK,%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 RETZTSK=1
69 S PXRMQUE=$$DEVICE^PXRMXQUE(ZTRTN,ZTDESC,.ZTSAVE,.%ZIS,.RETZTSK)
70 S VALMBCK="R"
71 Q
72 ;
73SORT(LISTIEN,PLNODE) ;Sort workfile as required
74 N DATA,DFN,IND,PNAME
75 ;Build the list in alphabetical order.
76 S IND=0
77 F S IND=$O(^PXRMXP(810.5,LISTIEN,30,IND)) Q:'IND D
78 .S DATA=$G(^PXRMXP(810.5,LISTIEN,30,IND,0)) Q:DATA=""
79 .S DFN=$P(DATA,U) Q:'DFN
80 .;DBIA #10035
81 .S PNAME=$P(^DPT(DFN,0),U,1) Q:PNAME=""
82 .S ^XTMP(PLNODE,PNAME)=DFN
83 Q
84 ;
Note: See TracBrowser for help on using the repository browser.