source: WorldVistAEHR/trunk/r/IMAGING-MAG-ZMAG/MAGGSIU2.m@ 724

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

revised back to 6/30/08 version

File size: 4.5 KB
Line 
1MAGGSIU2 ;WOIFO/GEK - Utilities for Image Add/Modify ; [ 12/27/2000 10:49 ]
2 ;;3.0;IMAGING;**7,8,85**;16-March-2007;;Build 1039
3 ;; Per VHA Directive 2004-038, this routine should not be modified.
4 ;; +---------------------------------------------------------------+
5 ;; | Property of the US Government. |
6 ;; | No permission to copy or redistribute this software is given. |
7 ;; | Use of unreleased versions of this software requires the user |
8 ;; | to execute a written test agreement with the VistA Imaging |
9 ;; | Development Office of the Department of Veterans Affairs, |
10 ;; | telephone (301) 734-0100. |
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
19MAKEFDA(MAGGFDA,MAGARRAY,MAGACT,MAGCHLD,MAGGRP,MAGGWP) ;
20 ; Create the FileMan FDA Array
21 ; Create Imaging Action Codes Array (for Pre and Post processing)
22 N MAGGFLD,MAGGDAT,GRPCT,WPCT,Z
23 S Z="" F S Z=$O(MAGARRAY(Z)) Q:Z="" D I $L(MAGERR) Q
24 . S MAGGFLD=$P(MAGARRAY(Z),U,1),MAGGDAT=$P(MAGARRAY(Z),U,2,99)
25 . ; If this entry is one of the action codes, store it in the action array.
26 . I $$ACTCODE^MAGGSIV(MAGGFLD) S MAGACT(MAGGFLD)=MAGGDAT Q
27 . ;
28 . ; If we are Creating a Group Entry, add any Images that are to be members of this group.
29 . I MAGGFLD=2005.04 D Q
30 . . S MAGGRP=1
31 . . I '+MAGGDAT Q ; making a group entry, with no group entries yet. This is OK.
32 . . S MAGCHLD(MAGGDAT)=""
33 . . S GRPCT=GRPCT+1
34 . . S MAGGFDA(2005.04,"+"_GRPCT_",+1,",.01)=MAGGDAT
35 . ;
36 . ; if we are getting a WP for Long Desc, set array to pass.
37 . I MAGGFLD=11 D ; this is one line of the WP Long Desc field.
38 . . S WPCT=WPCT+1,MAGGWP(WPCT)=MAGGDAT
39 . . S MAGGFDA(2005,"+1,",11)="MAGGWP"
40 . ; Set the Node for the UPDATE^DIC Call.
41 . S MAGGFDA(2005,"+1,",MAGGFLD)=MAGGDAT
42 . Q
43 ; Patch 8. Special processing for field 107 (ACQUISITION DEVICE)
44 ; We'll change any MAGGFDA(2005,"+1,",107) to MAGACT("ACQD")
45 ; This way the PRE processing of the array will check and create a new
46 ; ACQUISITION DEVICE file entry, if needed.
47 I $D(MAGACT("107")) S MAGACT("ACQD")=MAGACT("107") K MAGACT("107")
48 I $D(MAGGFDA(2005,"+1,",107)) S MAGACT("ACQD")=MAGGFDA(2005,"+1,",107) K MAGGFDA(2005,"+1,",107)
49 Q
50REQPARAM() ;Do required parameters have values. Called from MAGGSIUI
51 ; VARIABLES ARE SET AND KILLED IN THAT ROUTINE.
52 N CT
53 S CT=0
54 S MAGRY(0)="1^Checking for Required parameter values..."
55 I IDFN="" S CT=CT+1,MAGRY(CT)="DFN is Required. !"
56 I '$D(IMAGES),'CMTH S CT=CT+1,MAGRY(CT)="List of Images is Required. !"
57 ;
58 I (PXPKG=""),(DOCCTG=""),(IXTYPE="") S CT=CT+1,MAGRY(CT)="Procedure or Category or Index Type is Required. !"
59 I (PXPKG'=""),(DOCCTG'="") S CT=CT+1,MAGRY(CT)="Procedure OR Document Category. Not BOTH. !"
60 ;
61 I (PXPKG'=""),(PXIEN="") S CT=CT+1,MAGRY(CT)="Procedure IEN is Required. !"
62 I (PXPKG=""),(PXIEN'="") S CT=CT+1,MAGRY(CT)="Procedure Package is Required. !"
63 I (PXPKG'=""),(PXDT="") S CT=CT+1,MAGRY(CT)="Procedure Date is Required. !"
64 ;
65 ;Patch 8 index field check... could be using Patch 7 or Patch 8.
66 ; We're this far, so either PXIEN or DOCCTG is defined
67 I (IXTYPE'=""),(DOCCTG'="") S CT=CT+1,MAGRY(CT)="Image Type OR Document Category. Not BOTH. !"
68 ; MAGGSIA computes PACKAGE #40 and CLASS #41 when adding an Image (2005) entry.
69 ;
70 I TRKID="" S CT=CT+1,MAGRY(CT)="Tracking ID is Required. !"
71 I ACQD="" S CT=CT+1,MAGRY(CT)="Acquisition Device is Required. !"
72 ; ACQS ( could ? ) default to users institution i.e. DUZ(2)
73 I (ACQS="")&(ACQN="") S CT=CT+1,MAGRY(CT)="Acquisition Site IEN or Station Number is Required. !"
74 I (ACQS]"")&(ACQN]"") S CT=CT+1,MAGRY(CT)="Station IEN or Station Number, Not BOTH. !"
75 ;
76 I STSCB="" S CT=CT+1,MAGRY(CT)="Status Handler (TAG^ROUTINE) is Required. !"
77 ;
78 I (DOCCTG'=""),(DOCDT="") S CT=CT+1,MAGRY(CT)="Document Date is Required. !"
79 ;
80 I (CT>0) S MAGRY(0)="0^Required parameter is null" Q MAGRY(0)
81 ;Checks to stop Duplicate or incorrect Tracking ID's
82 ; //TODO: ?? check the Queue File, is this Tracking ID already Queued.
83 I (TRKID'="") I $D(^MAG(2005,"ATRKID",TRKID)) S MAGRY(0)="0^Tracking ID Must be Unique !"
84 I (TRKID'="") I ($L(TRKID,";")<2) S MAGRY(0)="0^Tracking ID Must have "";"" Delimiter"
85 ;
86 Q MAGRY(0)
Note: See TracBrowser for help on using the repository browser.