source: WorldVistAEHR/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUPRPN4.m@ 1361

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

initial load of WorldVistAEHR

File size: 3.0 KB
Line 
1TIUPRPN4 ;SLC/MJC;Print Progress Notes for Inpt Location; 6/26/01
2 ;;1.0;TEXT INTEGRATION UTILITIES;**25,100,121**;Jun 20, 1997
3 ;
4LOC ;sorts PNs for prting by WARD location
5 ;this option is for inpts
6 ;it prts all PNs for a selected date range for all patients
7 ;currently on the WARD
8 ;these notes are chartable contiguous or separate
9 ;[TIU PRINT PN WARD]
10 ;
11 N DIC,Y,TIUQT,TIULOC,WARD
12 D SETUP^TIUPRPN3("Print Progress Notes for ALL patients on WARD")
13DIC F D Q:$D(TIUQT)
14 .S DIC=8925.93,DIC(0)="AEQMNZ",DIC("A")="Select WARD Location: "
15 .S DIC("S")="I $P($G(^SC(+$P($G(^TIU(8925.93,+Y,0)),U),0)),U,3)=""W"""
16 .W ! D ^DIC K DIC I Y<0 S TIUQT=1 Q
17 .S WARD=Y(0,0)
18 .I '+$O(^DIC(42,"B",WARD,0)) D
19 ..S WARD=$P($G(^DIC(42,+$G(^SC(+$P(Y,U,2),42)),0)),U)
20 .I '+$O(^DIC(42,"B",WARD,0)) D Q
21 ..S TIUQT=1
22 ..W !!,"Invalid WARD LOCATION...Contact IRM."
23 .S TIULOC=+Y(0)_U_+Y_U_Y(0,0)
24 .;ien hosp loc^ien tiu prt param^external ward loc
25 .D NOTES(TIULOC)
26 Q
27 ;
28NOTES(TIULOC) ;sets date/time of when notes prted
29 N Y,BEG,MOVE,BED,DATE,CTR,TIULAST,ANS,IFN,TIUSPG,DFN,TIUQT
30 K ^TMP("TIUREPLACE",$J)
31 S TIULAST=$P($G(^TIU(8925.93,+$P(TIULOC,U,2),1)),U,2)
32 I TIULAST']"" S BEG=$$DATE() Q:BEG']""
33 I TIULAST]"" D Q:$D(TIUQT)
34 .I '+$G(TIULAST) D 2^TIUPRPN5 S BEG=$$DATE() I BEG']"" S TIUQT=1 Q
35 .W !!,"Notes were last printed for "_WARD_" at "
36 .W $$FMTE^XLFDT(+TIULAST,"1P"),!
37 .S ANS=$$READ^TIUU("YA","Print from this DATE/TIME on? ","YES","^D HELP^TIUPRPN5")
38 .I $D(DIRUT) S TIUQT=1 Q
39 .I +$G(ANS) S BEG=+TIULAST Q
40 .D 3^TIUPRPN5 S BEG=$$DATE() I BEG']"" S TIUQT=1 Q
41 S TIULAST=BEG
42 S MOVE=0 F S MOVE=$O(^DGPM("CN",WARD,MOVE)) Q:'MOVE D
43 .Q:'$D(^DGPM(MOVE,0))
44 .S DFN=$P(^DGPM(MOVE,0),U,3)
45 .S BEG=$E(TIULAST,1,12)-.0001 ;back up one minute
46 .F S BEG=$O(^TIU(8925,"APTP",DFN,BEG)) Q:'BEG D
47 ..S IFN=0 F S IFN=$O(^TIU(8925,"APTP",DFN,BEG,IFN)) Q:'IFN D
48 ...W "." D REPLACE^TIUPRPN3(IFN,BEG,1501)
49 S IFN=0 F S IFN=$O(^TMP("TIUREPLACE",$J,IFN)) Q:'IFN D
50 .S DFN=$P(^TIU(8925,IFN,0),U,2),BED=$G(^DPT(DFN,.101))_" "
51 .S BEG=^TMP("TIUREPLACE",$J,IFN,"DT")
52 .S ^TMP("TIUPR",$J,BED_";"_DFN,BEG,IFN)="Vice SF 509"
53 S CTR=+$G(^TMP("TIUREPLACE",$J))
54 I CTR=0 W $C(7),!!,"No notes have been signed for "_WARD_" since "
55 I W $$FMTE^XLFDT(TIULAST,"1P") G NOTESX
56 W !,">> "_CTR_" note"_$S(CTR>1:"s",1:"")_" found for WARD "_WARD
57 S TIUSPG=1,TIULAST=$$NOW^XLFDT
58 D DEV^TIUPRPN5
59NOTESX ;
60 K ^TMP("TIUREPLACE",$J)
61 Q
62DATE() W ! S %DT="AESTPX",%DT(0)="-NOW"
63 S %DT("A")="Print Notes Starting With (DATE/TIME): "
64 D ^%DT K %DT
65 S BEG=$S($D(DTOUT):"",Y<0:"",1:Y)
66 Q BEG
67 ;
68ADD ; enter/edit locations in file 8925.93
69 N DA,DIC,DIE,DR,TIUQT,Y
70 F W ! D Q:$D(TIUQT)
71 .S (DIC,DLAYGO)=8925.93,DIC(0)="AEQMNL"
72 .S DIC("A")="Select Clinic or Ward: "
73 .D ^DIC I Y<0 S TIUQT=1 Q
74 .S DIE=DIC,DA=+Y,DR="1.03;3" D ^DIE
75 K DLAYGO
76 Q
77 ;
78DIV ; enter/edit division params in file 8925.94
79 N DA,DIC,DIE,DR,TIUQT,Y
80 F W ! D Q:$D(TIUQT)
81 .S (DIC,DLAYGO)=8925.94,DIC(0)="AEQMNL"
82 .S DIC("A")="Select Division for PNs Outpatient Batch Print: "
83 .D ^DIC I Y<0 S TIUQT=1 Q
84 .S DIE=DIC,DA=+Y,DR=".02;1.02" D ^DIE
85 K DLAYGO
86 Q
Note: See TracBrowser for help on using the repository browser.