source: WorldVistAEHR/trunk/r/IMAGING-MAG-ZMAG/MAG7RSO.m@ 810

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

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1MAG7RSO ;WOIFO/PMK,MLH - copy radiology message from HLSDATA to ^MAGDHL7 - update diag codes in OBX segs ; 07 Jul 2003 12:30 PM
2 ;;3.0;IMAGING;**11**;14-April-2004
3 ;; +---------------------------------------------------------------+
4 ;; | Property of the US Government. |
5 ;; | No permission to copy or redistribute this software is given. |
6 ;; | Use of unreleased versions of this software requires the user |
7 ;; | to execute a written test agreement with the VistA Imaging |
8 ;; | Development Office of the Department of Veterans Affairs, |
9 ;; | telephone (301) 734-0100. |
10 ;; | |
11 ;; | The Food and Drug Administration classifies this software as |
12 ;; | a medical device. As such, it may not be changed in any way. |
13 ;; | Modifications to this software may result in an adulterated |
14 ;; | medical device under 21CFR820, the use of which is considered |
15 ;; | to be a violation of US Federal Statutes. |
16 ;; +---------------------------------------------------------------+
17 ;;
18 ;
19OBXUPD ; SUBROUTINE - called by ADDDTA^MAGDHL7
20 ; Update OBX diagnosis code info on radiology ORU messages.
21 ; DICOM requires a numeric code in its triplet.
22 ;
23 N IXOBX ; ---------------- index to OBX segments in MAG7WRK array
24 N DIAGCSTR ; ------------- diagnostic code string
25 N TESTSTR ; -------------- substring to test with
26 N TESTIX ; --------------- index of entries to test against
27 N DIAGCIX ; -------------- diagnostic code index in 78.3
28 ;
29 ; Look for DIAGNOSTIC CODE in each OBX segment. When that string is found,
30 ; try to pick up the numeric diagnosis code from the Radiology DIAGNOSTIC
31 ; CODES File (#78.3).
32 S IXOBX=""
33 F S IXOBX=$O(MAG7WRK("B","OBX",IXOBX)) Q:'IXOBX D
34 . I $G(MAG7WRK(IXOBX,3,1,2,1))="DIAGNOSTIC CODE",$G(MAG7WRK(IXOBX,2,1,1,1))="ST" D
35 . . S DIAGCSTR=$G(MAG7WRK(IXOBX,5,1,1,1))
36 . . K DIAGCIX
37 . . I DIAGCSTR]"" D
38 . . . S TESTSTR=$E(DIAGCSTR,1,30),TESTIX=""
39 . . . F S TESTIX=$O(^RA(78.3,"B",TESTSTR,TESTIX)) Q:'TESTIX D Q:$G(DIAGCIX)
40 . . . . I $P($G(^RA(78.3,TESTIX,0)),U)=DIAGCSTR S DIAGCIX=TESTIX
41 . . . . Q
42 . . . Q
43 . . I '$G(DIAGCIX) S DIAGCIX=9999 ; 'no code found' flag
44 . . S MAG7WRK(IXOBX,2,1,1,1)="CE"
45 . . S MAG7WRK(IXOBX,5,1,1,1)=DIAGCIX
46 . . S MAG7WRK(IXOBX,5,1,2,1)=DIAGCSTR
47 . . S MAG7WRK(IXOBX,5,1,3,1)="VISTA78.3"
48 . . Q
49 . Q
50 Q
Note: See TracBrowser for help on using the repository browser.