source: WorldVistAEHR/trunk/r/GEN_MED_OTHER-GMV/GMVSC0.m@ 1618

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

initial load of WorldVistAEHR

File size: 3.8 KB
RevLine 
[613]1GMVSC0 ;HOIFO/MD,YH,FT-CUMULATIVE VITALS/MEASUREMENTS FOR PATIENT OVER GIVEN DATE RANGE ;10/25/02 10:29
2 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; #10039 - FILE 42 references (supported)
6 ; #10061 - ^VADPT calls (supported)
7 ; #10103 - ^XLFDT calls (supported)
8 ;
9EN1(RESULT,GMVDATA) ; GMV CUMULATIVE REPORT [RPC entry point]
10 ; Cumulative Vitals Report
11 ; DFN - patient internal entry number (FILE 2)
12 ; GMRVSDT - start date/time of report range
13 ; GMRVFDT - end date/time of report range
14 ; GMVDEV - device name
15 ; GMVIEN - device internal entry name (FILE 3.5)
16 ; GMVPDT - date/time to print the report
17 ; GMVWARD - ward internal entry number (FILE 42)
18 ; GMVHLOC - hospital location internal entry number (FILE 44)
19 ; GMVRMLST - list of room numbers separated by commas (e.g., 200,210)
20 ;
21 N DFN,GMRVSDT,GMRVFDT,GMVDEV,GMVIEN,GMVPDT,GMVWARD,GMVHLOC,GMVRMLST
22 S DFN=$P(GMVDATA,U,1),GMRVSDT=$P(GMVDATA,U,2),GMRVFDT=$P(GMVDATA,U,3),GMVDEV=$P(GMVDATA,U,5),GMVIEN=+$P(GMVDATA,U,6),GMVPDT=$P(GMVDATA,U,7),GMVWARD=$P(GMVDATA,U,8),GMVHLOC=$P(GMVDATA,U,9),GMVRMLST=$P(GMVDATA,U,10)
23 S ZTIO=GMVDEV ;device
24 S ZTDTH=$S($G(GMVPDT)>0:GMVPDT,1:$$NOW^XLFDT()) ;date/time to print
25 S (ZTSAVE("DFN"),ZTSAVE("GMRVSDT"),ZTSAVE("GMRVFDT"))=""
26 S (ZTSAVE("GMVWARD"),ZTSAVE("GMVHLOC"),ZTSAVE("GMVRMLST"))=""
27 S ZTDESC="Cumulative vital/measurement report"
28 S ZTRTN="START^GMVSC0"
29 D ^%ZTLOAD
30 S RESULT=$S($G(ZTSK)>0:"Report sent to device. Task #: "_ZTSK,1:"Unable to task the report.")
31 K ZTSK,ZTIO,ZTDTH,ZTSAVE,ZTDESC,ZTRTN
32 Q
33START ; Start the report output
34 S:$D(ZTQUEUED) ZTREQ="@"
35 ; if selected roombeds, then set up GMVROOM array
36 I $L(GMVRMLST)>0 D
37 .F GMVLOOP=1:1 Q:$P(GMVRMLST,",",GMVLOOP)="" D
38 ..S GMVROOM($P(GMVRMLST,",",GMVLOOP))=""
39 ..Q
40 .Q
41 S GMVEDB=$S(DFN>0:"P",GMVRMLST]"":"S",1:"A") ;P is one patient, A is whole ward, S is selected rooms
42 S GMVWARD(1)=$S(GMVWARD>0:$P($G(^DIC(42,GMVWARD,0)),U,1),1:"") ;ward name
43 I $G(GMVEDB)="P" D
44 .D DEM^VADPT,INP^VADPT
45 .S GMRRMBD=$S(VAIN(5)'="":VAIN(5),1:" BLANK") ;roombed
46 .S GMVNAME=$S(VADM(1)'="":VADM(1),1:" BLANK") ;patient name
47 .S GMVWARD=$P(VAIN(4),"^") ;ward ien
48 .S GMVWARD(1)=$P(VAIN(4),"^",2) ;ward name
49 .D KVAR^VADPT K VA ;kill VADPT variables
50 .S ^TMP($J,GMRRMBD,GMVNAME,DFN)=""
51 E D WARD^GMVDS1 ;returns TMP global with list of patients
52 S (GMROUT,GMRPG)=0
53 S GMVRANGE=$$FMTE^XLFDT(GMRVSDT)_"-"_$$FMTE^XLFDT(GMRVFDT)
54 D NOW^%DTC S Y=% D D^DIQ
55 S GMRPDT=$P(Y,"@")_" ("_$P($P(Y,"@",2),":",1,2)_")"
56 S $P(GMRDSH,"-",80)=""
57 U IO
58 S GMRRMBD=""
59 N GPEDIS S GPEDIS=$O(^GMRD(120.52,"B","DORSALIS PEDIS",0)) Q:GPEDIS'>0
60 F S GMRRMBD=$O(^TMP($J,GMRRMBD)) Q:GMRRMBD=""!GMROUT S GMRNAM="" F S GMRNAM=$O(^TMP($J,GMRRMBD,GMRNAM)) Q:GMRNAM=""!GMROUT S DFN=0 F S DFN=$O(^TMP($J,GMRRMBD,GMRNAM,DFN)) Q:DFN'>0!GMROUT S GMRPG=0 D WRT Q:GMROUT D EN1^GMVSC1
61Q ; kill variables and quit
62 D Q^GMVSC1
63 K ^TMP($J)
64 K GMRBMI,GMRVHT,GMRINF,GMRPG,GMREDB,GMRNAM,GMRRMBD,GMRVWLOC,GMRWARD,GMRMSL,GMRROOM,GMRRMST,GMRVHLOC,GMRLEN,GMRI,GMROUT,GMRVSDT,GMRVFDT,GPRT,GMVLOOP
65 K GMVRMLST,GMVRANGE
66 D ^%ZISC
67 Q
68FOOTER ;REPORT FOOTER {called from GMVSC1, GMVSC2}
69 W !!,"*** (E) - Error entry",!! W:VADM(1)'="" ?$X-3,$E(VADM(1),1,15) W:VADM(2)'="" ?17,$P(VADM(2),"^",2) W:VADM(3)'="" ?30,$P(VADM(3),"^",2) W:VADM(4)'="" ?43,$P(VADM(4),"^")_" YRS"
70 W:VADM(5)'="" ?51,$P(VADM(5),"^",2)
71 W ?65,"VAF 10-7987j" W !,"Unit: "_$S($P(VAIN(4),"^",2)'="":$P(VAIN(4),"^",2),1:" "),?32,"Room: "_$S($P(VAIN(5),"^")'="":$P(VAIN(5),"^"),1:" "),!
72 I '$D(GMRVHLOC) S GMRVHLOC=$$HOSPLOC^GMVUTL1(+$G(VAIN(4)))
73 W "Division: "_$$DIVISION^GMVUTL1(+GMRVHLOC),!
74 Q
75WRT ;
76 S GMR1ST=1
77 K GMRSITE
78 D DEM^VADPT,INP^VADPT
79 S GWARD=$S($P(VAIN(4),"^",2)'="":$P(VAIN(4),"^",2),1:" ")
80 S GBED=$S(VAIN(5)'="":$P(VAIN(5),"^"),1:" ")
81 D HDR^GMVSC2
82 Q
Note: See TracBrowser for help on using the repository browser.