source: WorldVistAEHR/trunk/r/AUTOMATED_MED_INFO_EXCHANGE-DVBA-DVBC/DVBCTRN1.m@ 1710

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

initial load of WorldVistAEHR

File size: 1.6 KB
RevLine 
[613]1DVBCTRN1 ;ALB/JLU;AMIE link routine;12/21/92
2 ;;2.7;AMIE;**12**;Apr 10, 1995
3NSFT K DVBCHK
4 I $S('$D(DVBCDFN):1,DVBCDFN']"":1,1:0) S DVBCHK="-1^Patient's DFN not defined OR is null" Q
5 I $S('$D(DVBCXM):1,DVBCXM']"":1,1:0) S DVBCHK="-2^Exam not defined OR is null" Q
6 S DVBCDFN1=$O(^DVB(396.3,"B",DVBCDFN,0))
7 I 'DVBCDFN1 S DVBCHK="-3^No 2507 request for this patient" Q
8 ;for loop to handle multiple exams with same name
9 N FOUND,STOP,TOXM
10 S (DVBCXM1,FOUND,STOP)=0
11 F S DVBCXM1=$O(^DVB(396.6,"B",$E(DVBCXM,1,30),DVBCXM1)) Q:(DVBCXM1="")!(+$G(DVBCHK)<0) D
12 .Q:($P(^DVB(396.6,DVBCXM1,0),"^"))'=DVBCXM
13 .S FOUND=1 ;an entry does exist for exam passed in DVBCXM
14 .S DVBCOXM=$O(^DVB(396.4,"APS",DVBCDFN,DVBCXM1,"O",0))
15 .I STOP,DVBCOXM'="" S DVBCHK="-8^More than one open exam" Q
16 .I STOP,DVBCOXM="" Q
17 .; ^ multiple exams with same name but different pointer values.
18 .I $O(^DVB(396.4,"APS",DVBCDFN,DVBCXM1,"O",DVBCOXM)) S DVBCHK="-8^More than one open exam" Q
19 .I DVBCOXM'="" S STOP=1,TOXM=DVBCOXM
20 .; ^open exam found
21 I +$G(DVBCHK)<0 Q
22 I 'FOUND S DVBCHK="-4^No Exam by that name in the 2507 Exam file" Q
23 I 'STOP S DVBCHK="-6^No open Exam for data given" Q
24 S DVBCOXM=TOXM
25 I '$D(^DVB(396.4,DVBCOXM,0)) S DVBCHK="-7^Exam cross reference is bad" Q
26 S DVBCX=$P(^DVB(396.4,DVBCOXM,0),U,2)
27 I '$$OREQ($P(^DVB(396.3,DVBCX,0),"^",18)) S DVBCHK="-5^No open requests for data given" Q
28 S DVBCHK="396.3:"_DVBCX_":"_396.4_":"_DVBCOXM_";^Soft Link entry"
29 Q
30 ;
31OREQ(DVBX) ;
32 ;This function will check to see if there is an open request.
33 ;DVBCX should contain the REQUEST STATUS.
34 ;
35 I $S(DVBX'="P"&(DVBX'="S")&(DVBX'="T")&(DVBX'="NT"):1,1:0) Q 0
36 Q 1
Note: See TracBrowser for help on using the repository browser.