Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DVBCTRN

DVBCTRN.m

Go to the documentation of this file.
  1. DVBCTRN ;ALB/JLU;This is an integration routine;5/18/92
  1. ;;2.7;AMIE;;Apr 10, 1995
  1. ;
  1. EN2(DVBCROT,DVBCPAK,DVBCSFT,DVBCPHY,DVBCDTE) ;
  1. ;This entry point will first check to see if the soft link is valid
  1. ;if so then it will down load the information to AMIE.
  1. ;DVBCROT - This is the variable root (local or global) that is
  1. ; currently holding the information to be down loaded.
  1. ; It should not contain any parenthesis. Ex. JJ OR ^JJ
  1. ;DVBCPAK - This is the name of the package that is using this entry
  1. ; point.
  1. ;DVBCSFT - This is the soft link
  1. ;DVBCPHY - This is a pointer to the New Person file of the physican who
  1. ; performed the exam.
  1. ;DVBCDTE - This is the date the exam was performed. It must be in
  1. ; FM format.
  1. ;
  1. ;all must be defined in order for this entry except DVBCDTE and DVBCPHY
  1. ;point to be used.
  1. ;** Even though this entry point checks to see if the request and exam
  1. ;can still receive data, it should not be used in place of EN1 for this
  1. ;type of checking.
  1. ;
  1. N DVBCAGL1,DVBCAGL,DVBCFN2,DVBCFN3,DVBCX,DVBCNNUM,DVBEST,DVBAGL,DVBCST,DVBCST1,DVBX,DVBCST2,DVBCHK,DVBC,DVBCFN1,DVBCDT,DVBCRT1,DVBCRT2
  1. I $S('$D(DVBCROT):1,DVBCROT']"":1,1:0) Q "-1^Global root not defined or is null"
  1. I $S('$D(DVBCPAK):1,DVBCPAK']"":1,1:0) Q "-2^Sending package name not defined or is null"
  1. I $S('$D(DVBCSFT):1,DVBCSFT']"":1,1:0) Q "-3^Soft link not defined or is null"
  1. ;I $S('$D(DVBCDTE):1,DVBCDTE']"":1,1:0) Q "-3^Date of exam not defined."
  1. ;I $S('$D(DVBCPHY):1,DVBCPHY']"":1,1:0) Q "-3^Physician is not defined."
  1. ;I $D(DVBCPHY),($S(DVBCPHY']"":1,'$D(^VA(200,DVBCPHY,0)):1,1:0)) Q "-9^Check New Person file pointer value."
  1. S DVBCPHY=$S('$D(DVBCPHY):"",DVBCPHY']"":"",$D(^VA(200,DVBCPHY,0)):$P(^(0),U,1),1:"")
  1. I $D(DVBCDTE),(DVBCDTE'?7N0.1".".N) Q "-10^Check exam date."
  1. I '$D(DVBCDTE) S DVBCDTE=""
  1. ;
  1. D SFT
  1. I $P(DVBCHK,"^",1)<0 Q DVBCHK
  1. S DVBCAGL=DVBCFN3_DVBEST_",""RES"")"
  1. I '$D(@DVBCAGL@(0)) S ^(0)="^^0^0^"_DT_"^^^^"
  1. S DVBCST=$P(^(0),"^",3)+1 ;naked references the I '$D above.
  1. S DVBCST1=0
  1. S Y=DT D DD^%DT S DVBCDT=Y
  1. K Y
  1. F DVBX=1:1:3 S @DVBCAGL@(DVBCST,0)=$S(DVBX=2:"** "_DVBCPAK_" / "_DVBCDT_" **",1:" "),DVBCST=DVBCST+1,DVBCST1=DVBCST1+1
  1. S DVBCST2=""
  1. F DVBCST=DVBCST:1 S DVBCST2=$O(@DVBCROT@(DVBCST2)) Q:DVBCST2="" S @DVBCAGL@(DVBCST,0)=@DVBCROT@(DVBCST2),DVBCST1=DVBCST1+1
  1. S DVBCST=DVBCST-1
  1. S DVBCST1=DVBCST1+$P(@DVBCAGL@(0),"^",4)
  1. S $P(@DVBCAGL@(0),"^",1,5)="^^"_DVBCST_"^"_DVBCST1_"^"_DT
  1. ;setting physican and date
  1. S DIE="^DVB(396.4,",DA=DVBEST
  1. S DR=".04///C;.06////"_DVBCDTE_";.07////"_DVBCPHY
  1. D ^DIE
  1. K DA,DIE,DR
  1. Q "1^Down load of transcription complete"
  1. ;
  1. ;
  1. EN1(DVBCDFN,DVBCXM,DVBCSFT) ;
  1. ;This entry point is used to 1) acquire the soft link information and
  1. ;2) verify the availability of the soft link's request at a latter date.
  1. ;DVBCDFN - This is the DFN of the Patient the exam was or is to be
  1. ;performed on.
  1. ;DVBCXM - This is the name of the exam. A search of file 396.6 will
  1. ;be done to see if this exam exists.
  1. ;DVBCSFT - This is the soft link that the calling program wants
  1. ;verified. DVBCSFT need only be defined if a soft link is known and
  1. ;someone wishes to verify its availability.
  1. ;
  1. N DVBC,DVBCDFN1,DVBEST,DVBCFN1,DVBCFN2,DVBCFN3,DVBCHK,DVBCORQ,DVBCOXM,DVBCROT,DVBCST,DVBCST1,DVBCST2,DVBCX,DVBCXM1,DVBCRT1,DVBCRT2,DVBJ
  1. I $D(DVBCSFT) D SFT
  1. I '$D(DVBCSFT) D NSFT^DVBCTRN1
  1. Q DVBCHK
  1. ;
  1. SFT S DVBC=$P(DVBCSFT,";",1)
  1. S DVBCFN1=$P(DVBC,":",1)
  1. I 'DVBCFN1!('$D(^DIC(DVBCFN1,0,"GL"))) S DVBCHK="-1^File number of soft link is bad" Q
  1. I DVBCFN1'=396.3 S DVBCHK="-1.5^File number of soft link is incorrect." Q
  1. ;naked references ^dic(dvbcfn1,0,"gl") on line before
  1. S DVBCFN2=^("GL")
  1. S DVBCX=$P(DVBC,":",2)
  1. I DVBCX'?1.9N S DVBCHK="-2^Entry number in soft link is bad" Q
  1. S DVBCFN3=$P(DVBC,":",3)
  1. I 'DVBCFN3!('$D(^DIC(DVBCFN3,0,"GL"))) S DVBCHK="-3^Second file number in soft link is bad" Q
  1. I DVBCFN3'=396.4 S DVBCHK="-3.5^Second file number in soft link is incorrect." Q
  1. ;naked reference from ^dic(dvbcfn3,0,"gl")
  1. S DVBCFN3=^("GL")
  1. S DVBEST=$P(DVBC,":",4)
  1. I DVBEST'?1.9N S DVBCHK="-4^2507 Exam entry number in soft link is bad" Q
  1. S DVBCRT1=DVBCFN2_DVBCX_")"
  1. I '$D(@DVBCRT1@(0)) S DVBCHK="-5^This request nolonger exists" Q
  1. ;naked references indirected gloabal on line before
  1. I '$$OREQ^DVBCTRN1($P(^(0),"^",18)) S DVBCHK="-6^This request is nolonger open" Q
  1. S DVBCRT2=DVBCFN3_DVBEST_")"
  1. I '$D(@DVBCRT2@(0)) S DVBCHK="-7^Exam nolonger exists." Q
  1. ;naked references indirected global on line before
  1. I "OC"'[$P(^(0),"^",4) S DVBCHK="-8^Exam can nolonger accept data" Q
  1. I $P(^(0),"^",2)'=DVBCX S DVBCHK="-9^This exam does not belong to the proper request." Q
  1. S DVBCHK="1^Entry can still receive data"
  1. Q