MAGDSTA7 ;WOIFO/PMK - Q/R Retrieve of DICOM images from PACS to VistA ; Mar 04, 2022@13:42:59
Source file <MAGDSTA7.m>
action | A | extended action | Ea | event driver | Ed | subscriber | Su | protocol | O | limited protocol | LP | run routine | RR | broker | B | edit | E | server | Se | P | screenman | SM | inquire | I |
Name | Comments | DBIA/ICR reference |
---|---|---|
MAIN() | ; The main loop for the program for consults and procedures
; Input Variables ; SCANMODE ;-- "PATIENT", "DATE", or "NUMBER" ; DIRECTION ;- 1="ASCENDING" or 0="DESCENDING" ; BATCHSIZE ;- number of consult & procedure requests to process on this run ; BEGDATE ;--- begin date for search ; ENDDATE ;-- end date for search ; QRSCP ;----- default query/retrieve provider ; HOURS ;----- 24 character string of Y's and N's indicating active times ; |
|
CONLKUP() | ; Find the next study to retrieve
|
|
PATIENT() | ; use "AD" cross-reference to find studies for a single patient
; ^GMR(123,"AD",DFN,GMRCDATE,GMRCIEN)="" |
|
DATE() | ; use "AE" cross-reference to find completed studies
; ^GMR(123,"AE",SERVICE,STATUS,GMRCDATE,GMRCIEN)="" ; only look for COMPLETED studies and PARTIAL RESULTS |
|
NUMBER() | ; use GMRCIEN to find completed studies
; ^GMR(123,GMRC)=<consult record> |
|
CONLKUP1(GMRCIEN) | ; check consult
|
|
CONSULT(GMRCIEN,MAGIENLIST) | ; return a list of MAG Group IENs
; A consult may have multiple TIU notes and a TIU note may have multiple image groups. ; A consult may also have images associated in the DICOM TEMP LIST file (#2006.5839). |
|
CONSULT1(GMRCIEN,TIULIST) | ; return a list of TIU IENs
; a consult may have multiple TIU notes - get the list |
|
T892591(TIUIEN,MAGIENLIST) | ;
|
|
SETDATES(DATEBEG,DATESTOP,BEGDATE,ENDDATE,DIRECTION) | ; get date range
; get the beginning and ending dates for the FOR loop ; these are in GMRC reverse date format ; they are also DIRECTION specific |
|
GMRCDATE(GMRCDATE) | ; convert a GMRC date to a FM date and vice versa
|
|
HEADER(CONTINUE) | ;
|
Name | Line Occurrences |
---|---|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
FileNo | Call Tags |
---|---|
^GMR(123 - [#123] | GET1^DIQ, GETS^DIQ |
^TIU(8925.91 - [#8925.91] | GET1^DIQ |
Name | Line Occurrences (* Changed, ! Killed) |
---|---|
^GMR(123 - [#123] | PATIENT+7, PATIENT+11, DATE+12, DATE+16, NUMBER+8 |
^MAG(2006.5839 - [#2006.5839] | CONSULT+11, CONSULT+12 |
^TIU(8925.91 - [#8925.91] | T892591+3 |
^TMP("MAG" | NUMBER+5, NUMBER+6 |
Name | Line Occurrences |
---|---|
$$CONLKUP | MAIN+15 |
$$CONLKUP1 | PATIENT+14, DATE+19, NUMBER+12 |
$$CONSULT | CONLKUP1+9 |
$$CONSULT1 | CONSULT+4 |
$$DATE | CONLKUP+6 |
$$GMRCDATE | SETDATES+5, SETDATES+6, SETDATES+9, SETDATES+10 |
$$NUMBER | CONLKUP+9 |
$$PATIENT | CONLKUP+3 |
SETDATES | PATIENT+4, DATE+5 |
T892591 | CONSULT+8 |
>> | Not killed explicitly |
* | Changed |
! | Killed |
~ | Newed |
Name | Field # of Occurrence |
---|---|
A | CONSULT1+2~, CONSULT1+6 |
A( | CONSULT1+7, CONSULT1+8 |
ACNUMB | CONLKUP1+1~, CONLKUP1+6*, CONLKUP1+10 |
BATCHSIZE | NUMBER+2~, NUMBER+5*, NUMBER+8 |
BEGDATE | PATIENT+4, DATE+5, SETDATES~, SETDATES+5, SETDATES+10 |
>> CONSULTSERVICES( | DATE+6, DATE+8 |
CONTINUE | HEADER~, HEADER+1 |
DATEBEG | PATIENT+2~, PATIENT+4, PATIENT+5, DATE+3~, DATE+5, DATE+10, SETDATES~, SETDATES+5*, SETDATES+9* |
DATESTOP | PATIENT+2~, PATIENT+4, PATIENT+8, PATIENT+9, DATE+3~, DATE+5, DATE+13, DATE+14, SETDATES~, SETDATES+6* , SETDATES+10* |
DFN | PATIENT+7, PATIENT+11, CONLKUP1+1~, CONLKUP1+8*, CONLKUP1+10 |
DIRECTION | PATIENT+4, PATIENT+7, PATIENT+8, PATIENT+11, DATE+5, DATE+12, DATE+13, DATE+16, NUMBER+7, NUMBER+8 , SETDATES~, SETDATES+4 |
>> DIVISION | CONLKUP1+4 |
DONE | PATIENT+2~, PATIENT+5*, PATIENT+7, PATIENT+8*, PATIENT+9*, DATE+3~, DATE+10*, DATE+12, DATE+13*, DATE+14* |
ENDDATE | PATIENT+4, DATE+5, SETDATES~, SETDATES+6, SETDATES+9 |
ERROR | CONSULT+3~, CONSULT+4*, CONSULT+5 |
EXAMDATE | CONLKUP1+1~, CONLKUP1+7*, CONLKUP1+10 |
GMRCDATE | PATIENT+2~, PATIENT+5*, PATIENT+7*, PATIENT+8, PATIENT+9, PATIENT+11, DATE+3~, DATE+10*, DATE+12*, DATE+13 , DATE+14, DATE+16, GMRCDATE~, GMRCDATE+1 |
GMRCIEN | MAIN+10~, PATIENT+10*, PATIENT+11*, PATIENT+13, PATIENT+14, DATE+15*, DATE+16*, DATE+18, DATE+19, NUMBER+2~ , NUMBER+6*, NUMBER+7*, NUMBER+8*, NUMBER+10, NUMBER+12, CONLKUP1~, CONLKUP1+3, CONLKUP1+6, CONLKUP1+7, CONLKUP1+8 , CONLKUP1+9, CONLKUP1+10, CONSULT~, CONSULT+4, CONSULT+11, CONSULT1~, CONSULT1+5 |
GROUPIEN | CONSULT+3~, CONSULT+13*, CONSULT+14, T892591+1~, T892591+4*, T892591+5 |
I | CONLKUP1+1~, CONSULT+3~, CONSULT+7*, CONSULT+8, CONSULT1+2~, CONSULT1+7*, CONSULT1+10*, CONSULT1+11 |
IOF | HEADER+2 |
MAG20065839 | CONSULT+3~, CONSULT+10*, CONSULT+11*, CONSULT+12 |
MAGIENLIST | CONLKUP1+1~, CONLKUP1+9, CONLKUP1+10, CONSULT~, CONSULT+8, T892591~ |
MAGIENLIST( | CONSULT+14*, T892591+5* |
ORDERINGFACILITY | CONLKUP1+1~, CONLKUP1+3*, CONLKUP1+4 |
>> OUT(1 | CONSULT1+6* |
RUNTIME | MAIN+10~ |
>> SCANMODE | CONLKUP+2, CONLKUP+5, CONLKUP+8, CONLKUP+12 |
>> SERVICE | DATE+6*, DATE+8, DATE+12, DATE+16 |
SS2 | CONSULT1+2~, CONSULT1+7*, CONSULT1+8 |
STATUS | DATE+3~, DATE+7*, DATE+9, DATE+12, DATE+16 |
STOP | MAIN+10~, MAIN+15*, MAIN+16, CONLKUP+1~, CONLKUP+3*, CONLKUP+6*, CONLKUP+9*, CONLKUP+13*, CONLKUP+15, PATIENT+2~ , PATIENT+3*, PATIENT+7, PATIENT+11, PATIENT+14*, PATIENT+17, DATE+3~, DATE+4*, DATE+6, DATE+12, DATE+16 , DATE+19*, DATE+24, NUMBER+2~, NUMBER+3*, NUMBER+8, NUMBER+12*, NUMBER+14 |
STUDYCNT | NUMBER+2~, NUMBER+4*, NUMBER+8, NUMBER+11* |
TIU892591 | T892591+1~, T892591+2*, T892591+3*, T892591+4 |
TIUIEN | CONSULT1+2~, CONSULT1+8*, CONSULT1+9, CONSULT1+11, T892591~, T892591+3 |
TIULIST | CONSULT+3~, CONSULT+4, CONSULT1~, CONSULT1+3! |
TIULIST( | CONSULT+8, CONSULT1+11* |
TIULIST(0 | CONSULT+7, CONSULT1+4*, CONSULT1+10* |
X | MAIN+10~, CONSULT+3~, CONSULT+12*, CONSULT+13 |