source: WorldVistAEHR/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUPS177.m@ 1005

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

initial load of WorldVistAEHR

File size: 1.8 KB
Line 
1TIUPS177 ; SLC/AJB - Blank Doc Cleanup ; 06/12/04
2 ;;1.0;TEXT INTEGRATION UTILITIES;**177**;Jun 20, 1997
3 ;
4 Q
5EN ; control segment
6 N ANS
7 W @IOF
8 D ASKUSER(.ANS) Q:$G(ANS("EXIT"))="YES"
9 D
10 .N ZTDESC,ZTRTN,ZTSAVE,ZTIO,ZTSK
11 .S ZTDESC="TIUPS177 Blank Note Text Cleanup",ZTRTN="CLEAN^TIUPS177",ZTSAVE("*")="",ZTIO=""
12 .W ! D ^%ZTLOAD I '$D(ZTSK) Q
13 .W !!,"Your task # is: ",ZTSK,!
14EXIT Q
15ASKUSER(ANS) ;
16 N %DT,CNT,POP,X,Y
17 S %DT="AE",%DT(0)=$$NOW^XLFDT*-1
18 F CNT=1:1:2 D
19 . S %DT("A")=$S(CNT=1:"START WITH REFERENCE DATE: ",CNT=2:" GO TO REFERENCE DATE: ")
20 . S %DT("B")=$S(CNT=1:"Jan 01, 2003",CNT=2:$P($$HTE^XLFDT($H),"@"))
21 . D ^%DT
22 . I Y=-1 S CNT=2,ANS("EXIT")="YES" Q
23 . I CNT=1 S ANS("BEGDT")=$$DATE(Y,CNT),%DT(0)=ANS("BEGDT") Q
24 . S ANS("ENDDT")=$$DATE(Y,CNT),X=$P($$NOW^XLFDT,".")_".24" I ANS("ENDDT")>X S CNT=1
25 Q
26IFTEXT() ;
27 N TIUCHK
28 S TIUCHK=0 F S TIUCHK=$O(^TIU(8925,DA,"TEXT",TIUCHK)) Q:TIUCHK=""!TIUCHK>0
29 Q TIUCHK
30DATE(TIUDT,TIUSEQ) ;
31 I TIUDT["0000" S TIUDT=TIUDT/10000,TIUDT=TIUDT_$S(TIUSEQ=1:"0101",TIUSEQ=2:"1231")
32 I TIUSEQ=2 S TIUDT=TIUDT_".24"
33 Q TIUDT
34CLEAN ;
35 N DA,DR,DIE,N,TIUDT
36 S DA="",N=8925,TIUDT=ANS("BEGDT")
37 F S TIUDT=$O(^TIU(N,"F",TIUDT)) Q:TIUDT=""!(TIUDT>ANS("ENDDT")) F S DA=$O(^TIU(N,"F",TIUDT,DA)) Q:DA="" I '$D(^TIU(8925,"DAD",DA)),'$D(^TIU(8925.91,"ADI",DA)),'$D(^TIU(N,DA,"TEXT",0)),$P($G(^TIU(8925,DA,0)),U,5)>5,'$$IFTEXT D
38 . I $P($G(^TIU(8925,DA,0)),U,5)=15 Q
39 . N TIUCODE,TIUNOW
40 . S TIUCODE="A",TIUNOW=$$NOW^XLFDT,DIE=8925,DR=".05////15;1610////^S X=+DUZ;1611////^S X=TIUNOW;1612////^S X=TIUCODE"
41 . L +^TIU(8925,DA):0 I $T D ^DIE,AUDIT L -^TIU(8925,DA)
42 S XQA(DUZ)="",XQAMSG="TIUPS177 has finished."
43 D SETUP^XQALERT
44 Q
45AUDIT ;
46 N TIU,TIUIEN,TIUMSG
47 S TIU(8925.5,"+1,",.01)=DA
48 S TIU(8925.5,"+1,",2.01)=TIUNOW
49 S TIU(8925.5,"+1,",2.02)=DUZ
50 S TIU(8925.5,"+1,",2.03)=TIUCODE
51 D UPDATE^DIE("","TIU","TIUIEN","TIUMSG")
52 Q
Note: See TracBrowser for help on using the repository browser.