source: WorldVistAEHR/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUPNCV4.m@ 1482

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

initial load of WorldVistAEHR

File size: 4.1 KB
RevLine 
[613]1TIUPNCV4 ;SLC/DJP ;2/26/98 13:30
2 ;;1.0;TEXT INTEGRATION UTILITIES;**9**;Jun 20, 1997
3 ;
4ENTRY ;Entry point to set-up conversion
5 N DIC,TIUQUEUE
6 I $G(DUZ)'>0 W !!,"DUZ must be defined as an active user!",! Q
7 S TIU("DUZ")=DUZ
8 D INTRO^TIUPNCV5 I $G(TIU("QUIT")) K TIU Q
9 I $P($G(^TIU(8925.97,1,0)),U,3) W !!,"Conversion has been completed.",! K TIU Q
10 W ! S DIR(0)="Y",DIR("A")="Are you sure everything is okay"
11 S DIR("B")="NO",DIR("?")="^D HELP1^TIUPNCV4" D ^DIR Q:$D(DIRUT)!(Y=0)
12 S TIUQUEUE=$$READ^TIUU("Y","Would you like to QUEUE this Process","NO")
13 I +TIUQUEUE D PNDEVICE Q
14 W !!?9,$C(7),"Progress Notes Conversion Running in Foreground",!
15 D DRIVER^TIUPNCV
16 Q
17 ;
18PNDEVICE ;Permits site to queue conversion
19 N %,ZTDTH,ZTDESC,ZTIO,ZTSAVE,ZTSK,ZTRTN
20 S ZTSAVE("TIU*")="",ZTSAVE("GMRP*")=""
21 S:'$D(ZTDESC) ZTDESC="TIU PN CONVERSION"
22 S ZTRTN="DRIVER^TIUPNCV",ZTIO="" D ^%ZTLOAD
23 W !,$S($D(ZTSK):"Request Queued!",1:"Request Cancelled."),!
24 D ^%ZISC
25 Q
26 ;
27REPORT ;sends bulletin to initiator of conversion
28 I '$D(TIUUSER) S TIUUSER=DUZ
29 S XMY(TIUUSER)=""
30 S XMB="TIU PRN CONVERSION "_$S(GMRPCTR:"ERRORS",1:"CLEAN")
31 S XMDUZ="TIU PROGRESS NOTE CONVERSION"
32 S XMB(1)=TIUSTRT,XMB(2)=TIUEND,XMB(3)=TIUCTR
33 I ERRCTR S XMB(4)=ERRCTR,XMTEXT="^GMR(121,""ERROR"","
34 D ^XMB,KILL^XM K TIUEND,TIUSTRT,ERRCTR
35 Q
36 ;
37RESTART ;Permit restarting of conversion from last successfully processed note.
38 W !
39 K DIR W @IOF
40 W !!?10,"****** RESTART PROGRESS NOTE/TIU CONVERSION ******",!!
41 S GMRPST1=$P($G(^TIU(8925.97,1,0)),U,5)
42 I GMRPST1'>0 W !?5,"Conversion has NOT been previously run",!?5,"Please use the CONVERT PROGRESS NOTE option." K GMRPST1 Q
43 K DIR S DIR(0)="Y",DIR("A")="Do you wish to restart the conversion"
44 S DIR("B")="YES",DIR("?")="^D HELP2^TIUPNCV4" D ^DIR Q:$D(DIRUT)!(Y=0)
45 W !!?5,"A mail message documenting discrepancies encountered during "
46 W !,?5,"processing will be sent to you.",!
47 S TIU("DUZ")=DUZ
48 D MAIL^TIUPNCV5
49 S GMRPST=(GMRPST1+1)
50 W !!,"Restarting Progress Note Conversion at Record #"_GMRPST_"...",!
51 S $P(^TIU(8925.97,1,0),U,3)=""
52 S GMRPST=(GMRPST-1),RESTARTD=$$NOW^XLFDT
53 S ^GMR(121,"RESTART",GMRPST)=RESTARTD ;Records restart date/time
54 S ZTDESC="RESTART PN CONVERSION"
55 D PNDEVICE
56 Q
57 ;
58INDY ;Converts individual Progress Notes based on IEN in ^GMR(121
59 S TIUFPRIV=1
60 W @IOF W !!?18,"***** INDIVIDUAL RECORD CONVERSION *****",!
61 ;
62ENINDY ;Entry of IEN
63 K DIR S DIR(0)="NO^1:9999999"
64 S DIR("A")="Enter IEN of Note to be converted"
65 S DIR("?")="^D HELP4^TIUPNCV4" D ^DIR I $D(DIRUT) K DIR Q
66 I '$D(^GMR(121,Y)) W !,"Entry ",Y," not found in file 121",$C(7) G ENINDY
67 I +$P($G(^GMR(121,Y,1)),U,3)&($P($G(^GMR(121,Y,5)),U)=1) S TIUECS=$$ASKCOS^TIUPNCVU Q:'TIUECS ;If signed and uncosigned need to ask for expected cosigner, quit if none entered.
68 ;
69EMERG ;Emergency entrance - must pass "Y" and "EMER"
70 S GMRPIFN=Y,TIU("INDY")=1,GMRPCTR=0,TIUCTR=0
71 I $D(^GMR(121,"CNV",GMRPIFN)) W !?5,"Progress Note IEN "_GMRPIFN_" was converted in a prior session.",! K GMRPIFN,TIU("INDY") G ENINDY:'$D(EMER)
72 S NEWNODE=1 W:'$D(EMER) !!?5,"Now converting Progress Note "_GMRPIFN_"...",!
73 D MAIN^TIUPNCV8
74 I '$D(^GMR(121,"CNV",GMRPIFN)),$D(^GMR(121,"ERROR",GMRPIFN)) D G KILINDY
75 . W !!,"*****Progress Note "_GMRPIFN_" NOT converted*****",!
76 . W ^GMR(121,"ERROR",GMRPIFN),!
77 W:'$D(EMER) !,"Progress Note "_GMRPIFN_" successfully converted",!
78 ;
79KILINDY ;Cleans up the debris
80 K GMRPIFN,TIU("INDY"),DIR,NEWNODE,BADREC,TIUCTR
81 I $D(EMER) Q
82 G ENINDY
83 ;
84HELP1 ;Help for are you sure prompt
85 W !!,"Enter Yes if you're ready to start the conversion."
86 W !,"Press return or enter NO to stop this process."
87 Q
88HELP2 ;Help for RESTART prompt
89 W !!?5,"Enter YES to re-start/re-queue the conversion."
90 W !?5,"Press <ret> or enter NO to stop this option."
91 Q
92 ;
93HELP3 ;Help for IEN prompt
94 W !!?5,"The default is the next expected Internal File Number (IEN)"
95 W " for a note."
96 W !?5,"If another starting point is required, enter the IEN for that"
97 W " note."
98 W !?5,"Enter ""^"" to stop option without processing."
99 Q
100 ;
101HELP4 ;Help for INDY prompt
102 W !!?5,"Enter the Internal Entry Number (IEN) of the single Progress"
103 W !?5,"you wish to convert to TIU.",!
104 Q
105 ;
Note: See TracBrowser for help on using the repository browser.