source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAO7CMP.m@ 789

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

initial load of WorldVistAEHR

File size: 3.5 KB
RevLine 
[613]1RAO7CMP ;HISC/FPT,GJC-Completed Request from Rad to OE/RR! ;10/3/01 15:07
2 ;;5.0;Radiology/Nuclear Medicine;**10,18,26,28**;Mar 16, 1998
3 ;Last modification for P18 by SS, JULY 6, 2000
4EN1(RAOIFN) ; 'RAOIFN' is the ien in file 75.1
5 ; New vars & define the following variables: RAECH, RAECH array & RAHLFS
6 N A,DFN,RA,RA0,RA70,RA74,RABNORM,RACNT,RACPT,RACTIVDT,RADFN,RADTI,RAECH
7 N RAEXAM,RAHLFS,RAOBDT,RAPRIOR,RAPROC,RAPRVPHY,RAR,RARXAM,RATAB,RAVAR
8 N RAXSET
9 N RA18PROC ;P18 procedure ien
10 S RATAB=1 D EN1^RAO7UTL S RA0=$G(^RAO(75.1,RAOIFN,0)) Q:RA0']""
11 D SETVAR S RAR=$G(^RAO(75.1,RAOIFN,"R"))
12 S RAVAR="RATMP(",RAVARBLE="RATMP"
13 ; msh
14 S @(RAVAR_RATAB_")")=$$MSH^RAO7UTL("ORU^R01") ;P18 Event type
15 ; pid
16 S RATAB=RATAB+1,@(RAVAR_RATAB_")")=$$PID^RAO7UTL(RA0)
17 ; orc
18 S RATAB=RATAB+1,@(RAVAR_RATAB_")")="ORC"_RAHLFS_"RE"_RAHLFS_$P(RA0,U,7)_RAECH(1)_"OR"_RAHLFS_RAOIFN_RAECH(2)_RADTI_RAECH(2)_$S(RAXSET:"",1:RAEXAM)_RAECH(1)_"RA"_$$STR^RAO7UTL(4)_RA("ORC",7)_$$STR^RAO7UTL(5)_$P(RA0,U,14)
19 ; obr
20 I RAXSET D ; Exam is part of a set, check all others.
21 . S RABNORM=$$ABNOR^RAO7UTL1(RAOIFN,RADFN,RADTI)
22 . Q
23 E S RABNORM=$$DIAG^RAO7UTL(RADFN,RADTI,RAEXAM)
24 S RA("OBR",4)=$P(RACPT(0),U)_U_$P(RACPT(0),U,2)_U_"CPT4"_U_RA18PROC_U_$P(RAPROC(0),U)_"^99RAP" ;P18
25 S RA("STATUS")="F" ; Results Status
26 I 'RAXSET D
27 . S RAPRVPHY=$P(RA74(0),"^",9) ; Verifying Physician
28 . I RAPRVPHY="" D
29 .. S RAPRVPHY=$P(RA70(0),"^",15) ; Prim. Stf.
30 .. S:RAPRVPHY="" RAPRVPHY=$P(RA70(0),"^",12) ; Prim. Res.
31 .. Q
32 . Q
33 S RACTIVDT=$$HLDATE^HLFNC($P(RA0,"^",18),"TS") ; Status Update D/T
34 S RATAB=RATAB+1,@(RAVAR_RATAB_")")="OBR"_$$STR^RAO7UTL(4)_RA("OBR",4)_$$STR^RAO7UTL(3)_RAOBDT_$$STR^RAO7UTL(15)_RACTIVDT_$$STR^RAO7UTL(3)_RA("STATUS")_$$STR^RAO7UTL(7)_$G(RAPRVPHY)
35 ; obx
36 ; set abnormal flag, if found
37 I 'RAXSET D ; Not part of a set
38 . I +$O(^RARPT(RA70(17),"I",0)) D
39 .. S (A,RACNT)=0 F S A=$O(^RARPT(RA70(17),"I",A)) Q:A'>0 D
40 ... S RACNT=RACNT+1,RATAB=RATAB+1
41 ... S @(RAVAR_RATAB_")")="OBX"_RAHLFS_RACNT_RAHLFS_"TX"_RAHLFS_"I^Impression^L"_RAHLFS_"1"_RAHLFS_$G(^RARPT(RA70(17),"I",A,0))_$$STR^RAO7UTL(3)_$S(RACNT=1:RABNORM,1:"")
42 ... Q
43 .. Q
44 . E D
45 .. S RACNT=1,RATAB=RATAB+1
46 .. S @(RAVAR_RATAB_")")="OBX"_RAHLFS_RACNT_RAHLFS_"TX"_RAHLFS_"I^Impression^L"_RAHLFS_"1"_$$STR^RAO7UTL(4)_RABNORM
47 .. Q
48 . Q
49 E D ; Part of a set
50 . S RACNT=1,RATAB=RATAB+1
51 . S @(RAVAR_RATAB_")")="OBX"_RAHLFS_RACNT_RAHLFS_"TX"_RAHLFS_"I^Impression^L"_RAHLFS_"1"_RAHLFS_"Part of a set - see individual procedures"_$$STR^RAO7UTL(3)_RABNORM
52 . Q
53 K VA,VADM,VAERR
54 D MSG^RAO7UTL("RA EVSEND OR",.@RAVARBLE)
55 Q
56SETVAR ; Setup exam specific variables
57 S RADFN=+RA0,RADTI=+$O(^RADPT("AO",RAOIFN,RADFN,0)) ;P18
58 S RAEXAM=+$O(^RADPT("AO",RAOIFN,RADFN,RADTI,0)) ;P26
59 S RA70(0)=$G(^RADPT(RADFN,"DT",RADTI,"P",RAEXAM,0)) ;P26
60 ;if CPRS patch not installed always take procedure ien from 75.1
61 ;if not - then in case of Parent procedure take it from 75.1,otherwise-from 70
62 I '$$PATCH^XPDUTL("OR*3.0*92") S RA18PROC=+$P(RA0,U,2) ;P18
63 E S RA18PROC=$S($P(^RAMIS(71,+$P(RA0,U,2),0),U,6)="P":+$P(RA0,U,2),1:+$P(RA70(0),U,2)) ;P18;P26;P31
64 S RAPROC(0)=$G(^RAMIS(71,RA18PROC,0)),RAPROC(9)=+$P(RAPROC(0),U,9) ;P18
65 S RACPT(0)=$$NAMCODE^RACPTMSC(RAPROC(9),DT)
66 S RAPRIOR=$P(RA0,U,6)
67 S RAPRIOR=$S(RAPRIOR=1:"S",RAPRIOR=2:"A",RAPRIOR=9:"R",1:"")
68 S RA("ORC",7)="^^^^^"_RAPRIOR
69 S RARXAM(0)=$G(^RADPT(RADFN,"DT",RADTI,0))
70 S RAXSET=+$P(RARXAM(0),"^",5) ; '1' if part of xam set
71 S RAOBDT=$$HLDATE^HLFNC((9999999.9999-RADTI),"TS")
72 S RA70(17)=+$P(RA70(0),"^",17),RA74(0)=$G(^RARPT(RA70(17),0))
73 Q
Note: See TracBrowser for help on using the repository browser.