[613] | 1 | RAHLTCPU ; HIRMFO/GJC - Rad/Nuc Med HL7 TCP/IP Bridge utilities;10/10/07
|
---|
| 2 | ;;5.0;Radiology/Nuclear Medicine;**84**;Mar 16, 1998;Build 13
|
---|
| 3 | ;
|
---|
| 4 | LOCKX(RAERR,UNLOCK) ;lock/unlock the Rad/Nuc Med Patient record at one of two levels:
|
---|
| 5 | ;If part of a printset (RAY3(25)=2) lock at the "DT" level
|
---|
| 6 | ;Else lock at the "P" or case level
|
---|
| 7 | ;Input: RADFN, RADTI, & RACNI are all assumed to be defined.
|
---|
| 8 | ; UNLOCK: if defined the function unlocks the encounter at the appropriate level
|
---|
| 9 | ;Returns: RAERR (lock attempt only) if $D(RAERR)#2 lock failed, else lock successful
|
---|
| 10 | N RANODE,RAY3 S RAY3=$G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)),RAY3(25)=$P(RAY3,U,25)
|
---|
| 11 | S RANODE=$S(RAY3(25)=2:$NA(^RADPT(RADFN,"DT",RADTI)),1:$NA(^RADPT(RADFN,"DT",RADTI,"P",RACNI)))
|
---|
| 12 | I $G(UNLOCK)=1 L -@RANODE Q
|
---|
| 13 | L +@RANODE:DILOCKTM E S RAERR=$S(RAY3(25)=2:"Encounter",1:"Accession")_" locked within VistA"
|
---|
| 14 | Q
|
---|
| 15 | ;
|
---|
| 16 | LOCKR(RAERR,UNLOCK) ;lock/unlock the report associated with an exam record/
|
---|
| 17 | ;Input: RADFN, RADTI, & RACNI are all assumed to be defined.
|
---|
| 18 | ; UNLOCK: if defined the function unlocks the report lock
|
---|
| 19 | ;Returns: RAERR (lock attempt only) if $D(RAERR)#2 lock failed, else lock successful
|
---|
| 20 | N RANODE,RAY3 S RAY3=$G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)),RAY3(17)=$P(RAY3,U,17)
|
---|
| 21 | Q:RAY3(17)="" S RANODE=$NA(^RARPT(RAY3(17)))
|
---|
| 22 | I $G(UNLOCK)=1 L -@RANODE Q
|
---|
| 23 | L +@RANODE:DILOCKTM E S RAERR="The report has been locked within VistA"
|
---|
| 24 | Q
|
---|
| 25 | ;
|
---|