source: FOIAVistA/tag/r/IMAGING-MAG-ZMAG/MAGDIR8.m@ 1705

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

initial load of FOIAVistA 6/30/08 version

File size: 3.2 KB
Line 
1MAGDIR8 ;WOIFO/PMK - Read a DICOM image file ; 05/16/2005 09:23
2 ;;3.0;IMAGING;**11,51**;26-August-2005
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 Q
19 ; M2MB server
20 ;
21 ; This routine is invoked by the M2M Broker RPC to process an image.
22 ; It extracts each item from the REQUEST list and transfers control
23 ; to the appropriate routine to process it. These routines, in turn,
24 ; add items to the RESULT list for processing back on the gateway.
25 ;
26ENTRY(RESULT,REQUEST) ; RPC = MAG DICOM IMAGE PROCESSING
27 N ARGS ; ---- argument string of the REQUEST item
28 N DATETIME ;- fileman date/time of the study
29 N DCMPID ;--- DICOM patient id
30 N DFN ;------ VistA's internal patient identifier
31 N ERRCODE ;-- code for an error, if encountered
32 N IREQUEST ;- pointer to item in REQUEST array
33 N OPCODE ;--- operation code of the REQUEST item
34 N RETURN ;--- intermediate return code
35 ;
36 ; pass the request list and determine what has to be done
37 F IREQUEST=2:1:$G(REQUEST(1)) D
38 . S OPCODE=$P(REQUEST(IREQUEST),"|")
39 . S ARGS=$P(REQUEST(IREQUEST),"|",2,999)
40 . I OPCODE="STORE1" D
41 . . D ENTRY^MAGDIR81
42 . . Q
43 . E I OPCODE="ACQUIRED" D
44 . . D ACQUIRED^MAGDIR82
45 . . Q
46 . E I OPCODE="PROCESSED" D
47 . . D POSTPROC^MAGDIR82
48 . . Q
49 . E I OPCODE="CORRECT" D
50 . . D ENTRY^MAGDIR83
51 . . Q
52 . E I OPCODE="PATIENT SAFETY" D
53 . . D ENTRY^MAGDIR84
54 . . Q
55 . E I OPCODE="ROLLBACK" D
56 . . D ENTRY^MAGDIR85
57 . . Q
58 . E I OPCODE="CRASH" D
59 . . S I=1/0 ; generate an error on the server to test error trapping
60 . . Q
61 . E W !,"#",IREQUEST," -- Ignored: ",REQUEST(IREQUEST)
62 . Q
63 Q
64 ;
65ERROR(OPCODE,ERRCODE,MSG,ROUTINE) ; build the RESULT array for the error
66 ; this must be called after ^MAGDIRVE is invoked to put the message
67 ; into the RESULT array - otherwise the message will be lost
68 N I,X
69 S X=ERRCODE_"|"_$G(MSG("TITLE"))_"|"_ROUTINE_"|"_$G(MSG("CRITICAL"))
70 D RESULT^MAGDIR8(OPCODE,X)
71 S I="" F S I=$O(MSG(I)) Q:'I D
72 . I MSG(I)?1"Problem detected by routine".E D
73 . . ; add error code to the message
74 . . S MSG(I)=MSG(I)_" Error Code: "_ERRCODE
75 . . Q
76 . D RESULT^MAGDIR8("MSG","|"_MSG(I))
77 . Q
78 S $P(RESULT(RESULT(1)),"|",2)="END"
79 Q
80 ;
81RESULT(OPCODE,ARGS) ; add an item to the RESULT list
82 N LAST
83 S LAST=$G(RESULT(1),1) ; first element in array is counter
84 S LAST=LAST+1,RESULT(LAST)=OPCODE_"|"_ARGS,RESULT(1)=LAST
85 Q
Note: See TracBrowser for help on using the repository browser.