source: WorldVistAEHR/trunk/r/GEN_MED_OTHER-GMV/GMVER0.m@ 949

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

initial load of WorldVistAEHR

File size: 2.5 KB
Line 
1GMVER0 ;HOIFO/FT-VITALS ENTERED IN ERROR FOR A PATIENT ;10/25/02 10:26
2 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; #10061 - ^VADPT calls (supported)
6 ; #10103 - ^XLFDT calls (supported)
7 ; #10104 - ^XLFSTR calls (supported)
8 ;
9EN1(RESULT,GMVDATA) ; GMV ENTERED IN ERROR-PATIENT [RPC entry point]
10 ; Queues a report to a printer
11 ; GMVDATA=DFN^START DT^END DT^TYPE OF GRAPH^DEVICE^DEVICE IEN(#3.5)^
12 ; DATE/TIME TO PRINT REPORT
13 ;
14 N DFN,GMVBEG,GMVEND,GMVDEV,GMVIEN,GMVPDT
15 S DFN=+$P(GMVDATA,"^",1),GMVBEG=$P(GMVDATA,"^",2),GMVEND=$P(GMVDATA,"^",3),GMVDEV=$P(GMVDATA,"^",5),GMVIEN=+$P(GMVDATA,"^",6),GMVPDT=$P(GMVDATA,"^",7)
16 S ZTIO=GMVDEV ;device
17 S ZTDTH=$S($G(GMVPDT)>0:GMVPDT,1:$$NOW^XLFDT()) ;date/time to print
18 S (ZTSAVE("DFN"),ZTSAVE("GMVBEG"),ZTSAVE("GMVEND"))=""
19 S ZTDESC="Entered in error vital/measurement report"
20 S ZTRTN="START^GMVER0"
21 D ^%ZTLOAD
22 S RESULT=$S($G(ZTSK)>0:"Report sent to device. Task #: "_ZTSK,1:"Unable to task the report.")
23 K ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK
24 D ^%ZISC
25 Q
26START ; Start the report output
27 U IO
28 S:$D(ZTQUEUED) ZTREQ="@"
29 S GMVPAGE=0
30 S GMVDASH=$$REPEAT^XLFSTR("-",80) ;line of dashes
31 S GMVNOW=$$NOW^XLFDT() ;current date/time
32 S GMVNOW=$$FMTE^XLFDT(GMVNOW)
33 S GMVRANGE=$$FMTE^XLFDT(GMVBEG)_"-"_$$FMTE^XLFDT(GMVEND) ;date range in
34 ; external format (for header)
35 D DEM^VADPT ;get patient demographic data
36 S GMVNAME=VADM(1) ;patient name
37 S GMVSSN=$P(VADM(2),"^",2) ;patient ssn
38 D EN1^GMVER1(.GMVARRAY,DFN,GMVBEG,GMVEND) ;get entered-in-error data
39 D HEADER
40 S GMVNONE=$G(^TMP($J,"ERRORS",0))
41 I $L(GMVNONE)>0 W !,GMVNONE D KILL Q
42 S GMVDATE=0
43 F S GMVDATE=$O(^TMP($J,"ERRORS",GMVDATE)) Q:'GMVDATE D
44 .S GMVITY=0
45 .F S GMVITY=$O(^TMP($J,"ERRORS",GMVDATE,GMVITY)) Q:'GMVITY D
46 ..S GMVDA=0
47 ..F S GMVDA=$O(^TMP($J,"ERRORS",GMVDATE,GMVITY,GMVDA)) Q:'GMVDA D
48 ...S GMVLOOP=0
49 ...F S GMVLOOP=$O(^TMP($J,"ERRORS",GMVDATE,GMVITY,GMVDA,GMVLOOP)) Q:'GMVLOOP D
50 ....S GMVNODE=^TMP($J,"ERRORS",GMVDATE,GMVITY,GMVDA,GMVLOOP)
51 ....I $Y+6>IOSL D HEADER
52 ....W !,GMVNODE
53 ....I GMVLOOP=4 W !
54 ....Q
55 ...Q
56 ..Q
57 .Q
58KILL ; Kill variables
59 D KVAR^VADPT ;clean up VADPT variables
60 K ^TMP($J,"ERRORS")
61 K GMVDASH,GMVNAME,GMVNOW,GMVPAGE,GMVSSN,X,Y
62 D ^%ZISC
63 Q
64HEADER ; Report header
65 W:$Y>0 @IOF
66 S GMVPAGE=GMVPAGE+1
67 W !,GMVNOW,?22,"ENTERED IN ERROR VITAL/MEASUREMENT REPORT",?70,"PAGE: ",GMVPAGE
68 W !?22,GMVRANGE
69 W !?22,"Patient: ",GMVNAME,?$X+5,GMVSSN
70 W !!,"Date Vit./Meas. taken",?58,"User who made error"
71 W !,GMVDASH,!
72 Q
Note: See TracBrowser for help on using the repository browser.