source: WorldVistAEHR/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUHL7.m@ 1489

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

revised back to 6/30/08 version

File size: 3.7 KB
Line 
1TIUHL7 ; SLC/AJB - TIUHL7 Msg Mgr ; 10OCT05
2 ;;1.0;TEXT INTEGRATION UTILITIES;**200**;Jun 20, 1997
3 Q
4ACTION(ACT) ;
5 N TIUMSG,TIUSEL
6 D FULL^VALM1
7 I VALMCNT=0 W !,"No documents to select." H 3 Q
8 S TIUSEL=$P(XQORNOD(0),"=",2)
9 I TIUSEL="" D Q:'+TIUSEL
10 . I VALMLST=1 S TIUSEL=1 Q
11 . N DIR,X,Y
12 . S DIR("A")=$S(ACT="DELETE":"Select Message(s) to Delete",ACT="VIEW":"Select Message to View")_": (1-"_VALMLST_") "
13 . S DIR("?")=$S(ACT="DELETE":"Select one or more messages to be deleted",ACT="VIEW":"Select one message to view")
14 . S DIR(0)=$S(ACT="DELETE":"L",ACT="VIEW":"N")_"OA^1:"_VALMLST
15 . D ^DIR S TIUSEL=Y
16 I TIUSEL["," S TIUSEL=$E(TIUSEL,1,($L(TIUSEL)-1))
17 F X=1:1:$L(TIUSEL,",") S TIUMSG($P(TIUSEL,",",X))=$O(@VALMAR@("IDX",$P(TIUSEL,",",X),""))
18 I ACT="SELECT" S ACT=$S(+$L(TIUSEL,",")=1:"VIEW",1:"DELETE")
19 D @ACT
20 Q
21DELETE ;
22 D FULL^VALM1
23 W @IOF,"Deleting the following message(s):",!
24 W !," Receiving Sending Message",!
25 W IOUON," Message ID Date/Time Processed Application Application Status ",!,IOUOFF
26 S TIUSEL="" F S TIUSEL=$O(TIUMSG(TIUSEL)) Q:'+TIUSEL W @VALMAR@(TIUSEL,0),! ; TIUSEL," ",TIUMSG(TIUSEL),!
27 I $$READ^TIUU("Y","Delete message(s)") D
28 . S TIUSEL="" F S TIUSEL=$O(TIUMSG(TIUSEL)) Q:'+TIUSEL K ^XTMP("TIUHL7",$P(TIUMSG(TIUSEL),U,2),$P(TIUMSG(TIUSEL),U))
29 . W !!,"Deleting...finished."
30 W ! I $$READ^TIUU("EA","Press <RETURN> to continue")
31 D CLEAN^VALM10,INIT,RE^VALM4
32 S VALMBG=1
33 Q
34REFRESH ;
35 D CLEAN^VALM10,INIT,RE^VALM4
36 S VALMBG=1
37 Q
38VIEW ;
39 D EN^TIUHL7A
40 D CLEAN^VALM10,INIT,RE^VALM4
41 S VALMBG=1
42 Q
43EN ; main entry point for TIUHL7 MSG MGR
44 N POP
45 D EN^VALM("TIUHL7 MSG MGR")
46 Q
47HDR ; header code
48 N HDR S HDR="TIUHL7 Received Messages"
49 S VALMHDR(1)=$$SETSTR^VALM1(HDR,"",(IOM-$L(HDR))/2,$L(HDR))
50 S VALMHDR(2)=""
51 S VALMHDR(3)=" Receiving Sending Message"
52 D XQORM
53 Q
54INIT ; init variables and list array
55 N TIU,TIUDISP,TIUDT,TIUMID
56 S TIU("CUOFF")=$C(27)_"[?25l",TIU("CUON")=$C(27)_"[?25h" ; cursor values
57 W TIU("CUOFF"),!!,"Searching for messages..."
58 S (TIUDT,VALMCNT)=0,(TIUDISP,TIUMID)=""
59 F S TIUDT=$O(^XTMP("TIUHL7",TIUDT)) Q:'+TIUDT F S TIUMID=$O(^XTMP("TIUHL7",TIUDT,TIUMID)) Q:'+TIUMID D
60 . S VALMCNT=VALMCNT+1 W:VALMCNT#3=0 "."
61 . S TIUDISP=$$SETSTR^VALM1(VALMCNT,"",1,8)
62 . S TIUDISP=$$SETFLD^VALM1($P($G(^XTMP("TIUHL7",TIUDT,TIUMID,"MSGRESULT",1)),U,3),TIUDISP,"Message ID")
63 . S TIUDISP=$$SETFLD^VALM1($$FMTE^XLFDT(TIUDT),TIUDISP,"Date/Time Processed")
64 . S TIUDISP=$$SETFLD^VALM1($P($G(^XTMP("TIUHL7",TIUDT,TIUMID,"MSGRESULT",1)),U,4),TIUDISP,"RecApp")
65 . S TIUDISP=$$SETFLD^VALM1($P($G(^XTMP("TIUHL7",TIUDT,TIUMID,"MSGRESULT",1)),U,5),TIUDISP,"SendApp")
66 . S TIU=$P($G(^XTMP("TIUHL7",TIUDT,TIUMID,"MSGRESULT",1)),U,2),TIU=$S(TIU="AR":"Rejected",TIU="AA":"Accepted",1:"Unknown")
67 . S TIUDISP=$$SETFLD^VALM1(TIU,TIUDISP,"Status")
68 . D SET^VALM10(VALMCNT,TIUDISP,TIUMID_U_TIUDT)
69 ;
70 I VALMCNT=0 D
71 . S TIU="No records found to satisfy search criteria."
72 . D SET^VALM10(2,$$SETSTR^VALM1(TIU,"",(IOM-$L(TIU))/2,$L(TIU)),0)
73 Q
74HELP ; help code
75 I X="?" S POP=1
76 D FULL^VALM1
77 W !!,"The following actions are available:"
78 W !!,"View a Message - View a selected message"
79 W !,"Delete Message(s) - Delete selected message(s)"
80 W !,"Refresh Message List - Refresh display"
81 W !!,"If ONE message is selected, default action is VIEW"
82 W !,"If multiple messages are selected, default action is DELETE",!
83 I +$G(POP) I $$READ^TIUU("EA","Press <RETURN> to continue")
84 S VALMBCK="R",POP=0
85 Q
86EXIT ; exit code
87 D XQORM
88 Q
89EXPND ; expand code
90 Q
91XQORM ; default action for list manager
92 S XQORM("#")=$O(^ORD(101,"B","TIUHL7 MSG MGR SELECT",0))_U_"1:"_VALMCNT
93 Q
Note: See TracBrowser for help on using the repository browser.