source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAHLRS.m@ 1270

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1RAHLRS ;HIRMFO/CRT/PDW - Resend HL7 messages for selected cases ;Mar 16, 1998
2 ;;5.0;Radiology/Nuclear Medicine;**25,54,60,71,82**;Mar 16, 1998;Build 8
3 ;
4 ; Utility to RESEND HL7 messages
5 ;
6 ;;02/14/2006 BAY/KAM RA*5*71 Add ability to update exam data to V/R
7 N RACNI,RADFN,RADTI,RARPT,X
8 ;
9 D SETVARS Q:$G(RAIMGTY)=""
10 ;
11 F S X=$$RACNLU(.RADFN,.RADTI,.RACNI) Q:+X'>0 D Q:QUIT<0
12 .D RESEND(RADFN,RADTI,RACNI,.QUIT)
13 Q
14 ;
15RACNLU(RADFN,RADTI,RACNI) ; Select Case Number
16 ;
17 N RANOSCRN S RANOSCRN="" ; Don't limit cases to current Imaging Type
18 S (RADFN,RADTI,RADFN)=""
19 D ^RACNLU
20 Q X
21 ;
22RESEND(RADFN,RADTI,RACNI,QUIT) ; re-send exam message(s) to HL7 subscribers
23 ;
24 N RAED
25 ;
26 S QUIT=0
27 I '$D(DT) D ^%DT S DT=Y
28 ;
29 S RAED=$$RAED(RADFN,RADTI,RACNI)
30 S QUIT=$$OK(RADFN,RADTI,RACNI)
31 I QUIT>0 D
32 .I RAED[",REG," D
33 ..D EN^DDIOL("Re-sending 'EXAM REGISTERD' HL7 message...",,"!!,?6")
34 ..D REG^RAHLRPC
35 .I RAED[",CANCEL," D
36 ..D EN^DDIOL("Re-sending 'EXAM CANCELLED' HL7 message...",,"!,?6")
37 ..D CANCEL^RAHLRPC
38 .I RAED[",EXAM," D
39 ..S $P(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0),"^",30)="" ;Reset sent flag
40 ..D EN^DDIOL("Re-sending 'EXAMINED' HL7 message...",,"!,?6")
41 ..N RAEXMDUN D 1^RAHLRPC ;*60 Newed RAEXMDUN to prevent variable leak
42 .I RAED[",RPT," D
43 ..D EN^DDIOL("Re-sending 'REPORT VERIFIED' HL7 message...",,"!,?6")
44 ..D RPT^RAHLRPC
45 Q
46 ;
47RAED(RADFN,RADTI,RACNI) ; identify correct ^RAHLRPC entry point(s)
48 ;
49 N RASTAT,RAIMTYP,RAORD,RETURN,RARPST
50 S (RARPST,RASTAT)=""
51 ;
52 S RETURN=",REG,"
53 ;
54 S RASTAT=$$GET1^DIQ(70.03,RACNI_","_RADTI_","_RADFN,3,"I")
55 ;
56 S RAIMTYP=$$GET1^DIQ(72,+RASTAT,7)
57 S RAORD=$$GET1^DIQ(72,+RASTAT,3)
58 ;
59 S:RAORD=0 RETURN=RETURN_"CANCEL,"
60 ;
61 I $$GET1^DIQ(72,+RASTAT,8)="YES" D ; Generate Examined HL7 Message
62 .S RETURN=RETURN_"EXAM,"
63 ;
64 I RETURN'[",EXAM," D
65 .; also check previous statuses for 'Generate Examined HL7 Message'
66 .F S RAORD=$O(^RA(72,"AA",RAIMTYP,RAORD),-1) Q:+RAORD<1 D Q:RETURN[",EXAM,"
67 ..S RASTAT=$O(^RA(72,"AA",RAIMTYP,RAORD,0))
68 ..I $$GET1^DIQ(72,+RASTAT,8)="YES" S RETURN=RETURN_"EXAM,"
69 ;
70 I RARPT]"" D ; Check if Verified Report exists
71 .S RARPST=$$GET1^DIQ(74,RARPT,5,"I")
72 .I RARPST="V" S RETURN=RETURN_"RPT,"
73 ;
74 Q RETURN
75 ;
76OK(RADFN,RADTI,RACNI) ; Get User to confirm continue
77 ;
78 N X,RAEXST
79 ;
80 S RAEXST=$$GET1^DIQ(70.03,RACNI_","_RADTI_","_RADFN,3)
81 ;
82 S X="",$P(X,"=",70)=""
83 D EN^DDIOL(X,"","!?5")
84 S DIR("A")="Re-send all HL7 messages for this '"_RAEXST_"' case?"
85 S DIR(0)="Y",DIR("B")="YES" D ^DIR
86 I Y="^" Q -1
87 Q Y
88 ;
89SETVARS ; Setup key Rad/Nuc Med variables
90 ;
91 I $O(RACCESS(DUZ,""))="" D SETVARS^RAPSET1(0)
92 Q:'($D(RACCESS(DUZ))\10) ; user does not have location access
93 I $G(RAIMGTY)="" D SETVARS^RAPSET1(1) K:$G(RAIMGTY)="" XQUIT
94 Q
Note: See TracBrowser for help on using the repository browser.