source: WorldVistAEHR/trunk/r/AUTOMATED_MED_INFO_EXCHANGE-DVBA-DVBC/DVBACRRR.m@ 1177

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

initial load of WorldVistAEHR

File size: 3.1 KB
Line 
1DVBACRRR ;ALB/GTS-557/THM-REPRINT 21-DAY CERT FOR THE RO ;21 JUL 89
2 ;;2.7;AMIE;**42**;Apr 10, 1995
3 ;
4 D INIT
5 I CONT=0 G KIL
6 D HDR
7 S DVBSEL=$$SELECT^DVBAUTL5("ORIGINAL PROCESSING DATE","21 Day Certificate")
8 I DVBSEL="D" S SDATE=$$DATE^DVBACRRP G:SDATE<0 KIL
9 I DVBSEL="N" S XDA=$$PAT^DVBAUTL5("RO") G:XDA<1 KIL
10 I DVBSEL=0 G KIL
11 I 'CONT G KIL
12 D DEVICE
13 I 'CONT G KIL
14 D DATA
15KIL D KILL
16 Q
17 ;
18DEVICE ;
19 S VAR(1,0)="0,0,0,2:0,0^"
20 D WR^DVBAUTL4("VAR")
21 K VAR
22 S %ZIS="AEQ"
23 D ^%ZIS
24 K %ZIS
25 I POP S CONT=0 Q
26 I $D(IO("Q")) DO
27 .S CONT=0
28 .S ZTIO=ION,ZTDESC="21-day Cert reprint",ZTRTN="DATA^DVBACRRR"
29 .F I="DVBSEL","XDA","DVBAD2","FDT(0)","HD","HD1","SDATE","NODTA" S ZTSAVE(I)=""
30 .D ^%ZTLOAD
31 .D ^%ZISC
32 .I $D(ZTSK) DO
33 ..S VAR(1,0)="0,0,0,2:2,0^Request queued."
34 ..D WR^DVBAUTL4("VAR")
35 ..K VAR
36 ..Q
37 .Q
38 Q
39 ;
40DATA ;
41 I DVBSEL="D" DO ;by date range
42 .U IO
43 .F XDA=0:0 S XDA=$O(^DVB(396,"AC",DVBAD2,"P",XDA)) Q:XDA="" S DFN=$P(^DVB(396,XDA,0),U,1) I $P(^(4),U,4)=SDATE D CREATE
44 .Q
45 I DVBSEL="N" DO ;by name/ssn
46 .S DFN=$P(^DVB(396,XDA,0),U,1)
47 .D CREATE
48 .Q
49 I NODTA=0 DO ;no data found
50 .S VAR(1,0)="0,0,0,2:2,0^No data found to reprint"
51 .D WR^DVBAUTL4("VAR")
52 .K VAR
53 .Q
54 ;
55KILL K DVBAON2,DVBSEL,VAR,DVBAD2,CONT
56 Q:$G(DVBGUI) D:$D(ZTQUEUED) KILL^%ZTLOAD
57 D KILL^DVBAUTIL
58 Q
59 ;
60CREATE ;CERTIFICATE CREATE
61 I $D(^DVB(396,XDA,2)) Q:$P(^(2),U,10)="L"
62 I '$D(^DPT(DFN,0)) W:(IOST?1"C-".E)!($D(DVBAON2)) @IOF
63 I '$D(^DPT(DFN,0)) W !!,"Patient record missing for DFN ",DFN,!!
64 I '$D(^DPT(DFN,0)) S DVBAON2="" Q
65 S PNAM=$P(^DPT(DFN,0),U,1),SSN=$P(^(0),U,9),CNUM=$S($D(^DPT(DFN,.31)):$P(^(.31),U,3),1:"Unknown")
66 S WARD=$P(^DVB(396,XDA,4),U,6),BED=$P(^(4),U,7),DCHGDT=$P(^(4),U,5),ADMDT=$P(^(0),U,4)
67 U IO W:(IOST?1"C-".E)!($D(DVBAON2)) @IOF
68 W !,FDT(0),?32,"REPORT OF CONTACT",!,?31,"21-DAY CERTIFICATE",?(80-11),"PAGE: 1",!,?(80-$L(HD1)\2),HD1,!!!!!!!,"Patient name: ",?16,PNAM,!,?9,"SSN: ",?16,SSN,?33,"Claim #: ",?43,CNUM,!!,?9,"Ward: ",?16,WARD,?30,"Bed: ",?36,BED,!!!
69 W " The patient above has been hospitalized for 21 consecutive days ",!,"from " S Y=ADMDT X ^DD("DD") W Y," to " S Y=DCHGDT X ^DD("DD") W Y,", and the major diagnosis for",!,"this period is:",!!!
70 K ^UTILITY($J,"W")
71 F LINE=0:0 S LINE=$O(^DVB(396,XDA,3,LINE)) Q:LINE="" S X=^(LINE,0),DIWL=5,DIWR=75,DIWF="NW" D ^DIWP
72 D ^DIWW W !!!,"A signed copy of this document is on file at "_HD1,!
73 W !!?5,"R0C 119",!
74 S NODTA=1,DVBAON2=""
75 Q
76 ;
77HDR ;Displays the header to this option.
78 S VAR(1,0)="0,0,(IOM-$L(HD)\2),1:3,1:0^"_HD
79 D WR^DVBAUTL4("VAR")
80 K VAR
81 S VAR(1,0)="0,0,0,0:2,0^This program REPRINTS 21-day certificates for the RO."
82 D WR^DVBAUTL4("VAR")
83 K VAR
84 Q
85 ;
86INIT ;sets up and checks various variables
87 S CONT=1
88 D DUZ2^DVBAUTIL
89 I $D(DVBAQUIT) S CONT=0
90 I $D(DUZ)#2=0 DO
91 .S VAR(1,0)="1,0,0,2:2,0^Your USER NUMBER is missing. Call the site manager."
92 .D WR^DVBAUTL4("VAR")
93 .K VAR
94 .I '$D(DVBGUI) D PAUSE^DVBCUTL4
95 .S CONT=0
96 .Q
97 I CONT=0 Q
98 S NODTA=0,HD="REGIONAL OFFICE 21-DAY CERTIFICATE REPRINTING"
99 I '$D(DVBGUI) D HOME^%ZIS
100 D NOPARM^DVBAUTL2
101 I $D(DVBAQUIT) S CONT=0
102 S HD1=$$SITE^DVBCUTL4
103 I '$D(DT) S X="T" D ^%DT S DT=Y
104 S Y=DT X ^DD("DD") S FDT(0)=Y
105 Q
Note: See TracBrowser for help on using the repository browser.