source: FOIAVistA/trunk/r/AUTOMATED_MED_INFO_EXCHANGE-DVBA-DVBC/DVBCTRN.m@ 1437

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

initial load of FOIAVistA 6/30/08 version

File size: 4.6 KB
Line 
1DVBCTRN ;ALB/JLU;This is an integration routine;5/18/92
2 ;;2.7;AMIE;;Apr 10, 1995
3 ;
4EN2(DVBCROT,DVBCPAK,DVBCSFT,DVBCPHY,DVBCDTE) ;
5 ;This entry point will first check to see if the soft link is valid
6 ;if so then it will down load the information to AMIE.
7 ;DVBCROT - This is the variable root (local or global) that is
8 ; currently holding the information to be down loaded.
9 ; It should not contain any parenthesis. Ex. JJ OR ^JJ
10 ;DVBCPAK - This is the name of the package that is using this entry
11 ; point.
12 ;DVBCSFT - This is the soft link
13 ;DVBCPHY - This is a pointer to the New Person file of the physican who
14 ; performed the exam.
15 ;DVBCDTE - This is the date the exam was performed. It must be in
16 ; FM format.
17 ;
18 ;all must be defined in order for this entry except DVBCDTE and DVBCPHY
19 ;point to be used.
20 ;** Even though this entry point checks to see if the request and exam
21 ;can still receive data, it should not be used in place of EN1 for this
22 ;type of checking.
23 ;
24 N DVBCAGL1,DVBCAGL,DVBCFN2,DVBCFN3,DVBCX,DVBCNNUM,DVBEST,DVBAGL,DVBCST,DVBCST1,DVBX,DVBCST2,DVBCHK,DVBC,DVBCFN1,DVBCDT,DVBCRT1,DVBCRT2
25 I $S('$D(DVBCROT):1,DVBCROT']"":1,1:0) Q "-1^Global root not defined or is null"
26 I $S('$D(DVBCPAK):1,DVBCPAK']"":1,1:0) Q "-2^Sending package name not defined or is null"
27 I $S('$D(DVBCSFT):1,DVBCSFT']"":1,1:0) Q "-3^Soft link not defined or is null"
28 ;I $S('$D(DVBCDTE):1,DVBCDTE']"":1,1:0) Q "-3^Date of exam not defined."
29 ;I $S('$D(DVBCPHY):1,DVBCPHY']"":1,1:0) Q "-3^Physician is not defined."
30 ;I $D(DVBCPHY),($S(DVBCPHY']"":1,'$D(^VA(200,DVBCPHY,0)):1,1:0)) Q "-9^Check New Person file pointer value."
31 S DVBCPHY=$S('$D(DVBCPHY):"",DVBCPHY']"":"",$D(^VA(200,DVBCPHY,0)):$P(^(0),U,1),1:"")
32 I $D(DVBCDTE),(DVBCDTE'?7N0.1".".N) Q "-10^Check exam date."
33 I '$D(DVBCDTE) S DVBCDTE=""
34 ;
35 D SFT
36 I $P(DVBCHK,"^",1)<0 Q DVBCHK
37 S DVBCAGL=DVBCFN3_DVBEST_",""RES"")"
38 I '$D(@DVBCAGL@(0)) S ^(0)="^^0^0^"_DT_"^^^^"
39 S DVBCST=$P(^(0),"^",3)+1 ;naked references the I '$D above.
40 S DVBCST1=0
41 S Y=DT D DD^%DT S DVBCDT=Y
42 K Y
43 F DVBX=1:1:3 S @DVBCAGL@(DVBCST,0)=$S(DVBX=2:"** "_DVBCPAK_" / "_DVBCDT_" **",1:" "),DVBCST=DVBCST+1,DVBCST1=DVBCST1+1
44 S DVBCST2=""
45 F DVBCST=DVBCST:1 S DVBCST2=$O(@DVBCROT@(DVBCST2)) Q:DVBCST2="" S @DVBCAGL@(DVBCST,0)=@DVBCROT@(DVBCST2),DVBCST1=DVBCST1+1
46 S DVBCST=DVBCST-1
47 S DVBCST1=DVBCST1+$P(@DVBCAGL@(0),"^",4)
48 S $P(@DVBCAGL@(0),"^",1,5)="^^"_DVBCST_"^"_DVBCST1_"^"_DT
49 ;setting physican and date
50 S DIE="^DVB(396.4,",DA=DVBEST
51 S DR=".04///C;.06////"_DVBCDTE_";.07////"_DVBCPHY
52 D ^DIE
53 K DA,DIE,DR
54 Q "1^Down load of transcription complete"
55 ;
56 ;
57EN1(DVBCDFN,DVBCXM,DVBCSFT) ;
58 ;This entry point is used to 1) acquire the soft link information and
59 ;2) verify the availability of the soft link's request at a latter date.
60 ;DVBCDFN - This is the DFN of the Patient the exam was or is to be
61 ;performed on.
62 ;DVBCXM - This is the name of the exam. A search of file 396.6 will
63 ;be done to see if this exam exists.
64 ;DVBCSFT - This is the soft link that the calling program wants
65 ;verified. DVBCSFT need only be defined if a soft link is known and
66 ;someone wishes to verify its availability.
67 ;
68 N DVBC,DVBCDFN1,DVBEST,DVBCFN1,DVBCFN2,DVBCFN3,DVBCHK,DVBCORQ,DVBCOXM,DVBCROT,DVBCST,DVBCST1,DVBCST2,DVBCX,DVBCXM1,DVBCRT1,DVBCRT2,DVBJ
69 I $D(DVBCSFT) D SFT
70 I '$D(DVBCSFT) D NSFT^DVBCTRN1
71 Q DVBCHK
72 ;
73SFT S DVBC=$P(DVBCSFT,";",1)
74 S DVBCFN1=$P(DVBC,":",1)
75 I 'DVBCFN1!('$D(^DIC(DVBCFN1,0,"GL"))) S DVBCHK="-1^File number of soft link is bad" Q
76 I DVBCFN1'=396.3 S DVBCHK="-1.5^File number of soft link is incorrect." Q
77 ;naked references ^dic(dvbcfn1,0,"gl") on line before
78 S DVBCFN2=^("GL")
79 S DVBCX=$P(DVBC,":",2)
80 I DVBCX'?1.9N S DVBCHK="-2^Entry number in soft link is bad" Q
81 S DVBCFN3=$P(DVBC,":",3)
82 I 'DVBCFN3!('$D(^DIC(DVBCFN3,0,"GL"))) S DVBCHK="-3^Second file number in soft link is bad" Q
83 I DVBCFN3'=396.4 S DVBCHK="-3.5^Second file number in soft link is incorrect." Q
84 ;naked reference from ^dic(dvbcfn3,0,"gl")
85 S DVBCFN3=^("GL")
86 S DVBEST=$P(DVBC,":",4)
87 I DVBEST'?1.9N S DVBCHK="-4^2507 Exam entry number in soft link is bad" Q
88 S DVBCRT1=DVBCFN2_DVBCX_")"
89 I '$D(@DVBCRT1@(0)) S DVBCHK="-5^This request nolonger exists" Q
90 ;naked references indirected gloabal on line before
91 I '$$OREQ^DVBCTRN1($P(^(0),"^",18)) S DVBCHK="-6^This request is nolonger open" Q
92 S DVBCRT2=DVBCFN3_DVBEST_")"
93 I '$D(@DVBCRT2@(0)) S DVBCHK="-7^Exam nolonger exists." Q
94 ;naked references indirected global on line before
95 I "OC"'[$P(^(0),"^",4) S DVBCHK="-8^Exam can nolonger accept data" Q
96 I $P(^(0),"^",2)'=DVBCX S DVBCHK="-9^This exam does not belong to the proper request." Q
97 S DVBCHK="1^Entry can still receive data"
98 Q
Note: See TracBrowser for help on using the repository browser.