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

BLRALFN.m

Go to the documentation of this file.
  1. BLRALFN ;DAOU/ALA-Lab ES Functions [ 11/18/2002 1:36 PM ]
  1. ;;5.2;LR;**1013,1015**;NOV 18, 2002
  1. ;
  1. ;**Program Description**
  1. ; Lab Electronic Signature functions
  1. ;
  1. FPS ; Full Patient Summary
  1. ; Call the current Full Patient Summary code but bypass
  1. ; the selection of the patient which is already defined
  1. ;
  1. NEW LRIDT
  1. S LRIN=0,LRIDT=0,LREND=0,LROUT=9999999,LRDIS=0 K ZTRTN,DIC,X2
  1. I $G(LRDFN)="" Q
  1. ;
  1. D PT^LRX
  1. W !,"** WARNING! This report must be queued to a printer. **"
  1. ;HANG 1
  1. N DIR,X,Y
  1. K DIR S DIR(0)="E",DIR("T")=10,DIR("A")="Press return to continue " D ^DIR
  1. K DIR,X,Y
  1. ;
  1. D QUE^LRACSUM G:POP END
  1. I $D(ZTSK) S IOP="HOME" D ^%ZIS
  1. I '$D(ZTSK) D LRLLOC^LRACSUM
  1. ;
  1. S BLDATA=$G(^TMP("BLRA",$J,"ZNODE",ACN))
  1. S LRDFN=$P(BLDATA,U,1),LRSS=$P(BLDATA,U,2),LRIDT=$P(BLDATA,U,3)
  1. I $E(LRSS,1,2)="CH" D CH^BLRALBD
  1. I $E(LRSS,1,2)="MI" D MI^BLRALBD
  1. ;NEW VALMCNT
  1. S VALMCNT=+$G(BLRADSP)
  1. S VALMBCK="R"
  1. ;
  1. K LRDPF
  1. I $D(ZTSK) K ZTSK Q
  1. Q
  1. END ;
  1. ; END^LRACM is killing too many variables, we may need to
  1. ; retain some to return back to ListMan
  1. ;D END^LRACM
  1. ;D ^%ZISC
  1. ;
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. FWD ; Forward a MailMan message with the Lab Results
  1. K ^TMP($J,"BLRAMSG"),^BLRALAB(9009027.1,DUZ,100)
  1. S DIR(0)="Y"
  1. S DIR("A")="Do you wish to add additional comments to send with this lab result"
  1. D ^DIR I $G(Y)=1 D WP
  1. ;
  1. ; Get the data from the word processing field
  1. S BLRANN=0
  1. F S BLRANN=$O(^BLRALAB(9009027.1,DUZ,100,BLRANN)) Q:'BLRANN D
  1. . S BLRALL=$G(BLRALL)+1
  1. . S ^TMP($J,"BLRAMSG",BLRALL,0)=$G(^BLRALAB(9009027.1,DUZ,100,BLRANN,0))
  1. ;
  1. ; Separate lab result build from additional text with a
  1. ; new line
  1. S BLRALL=$G(BLRALL)+1,^TMP($J,"BLRAMSG",BLRALL,0)=" "
  1. ;
  1. ; If clinical chem, set the patient header first
  1. I LRSS="CH" D
  1. . F BLRAI=1:1:3 S BLRALL=$G(BLRALL)+1,^TMP($J,"BLRAMSG",BLRALL,0)=VALMHDR(BLRAI)
  1. ;
  1. S BLRANN=0
  1. F S BLRANN=$O(^TMP($J,"BLRA",BLRANN)) Q:'BLRANN D
  1. . S BLRALL=$G(BLRALL)+1
  1. . S ^TMP($J,"BLRAMSG",BLRALL,0)=$G(^TMP($J,"BLRA",BLRANN,0))
  1. ;
  1. S XMSUB="LAB RESULT FOR YOUR REVIEW",XMDUZ=DUZ
  1. S XMTEXT="^TMP($J,""BLRAMSG"","
  1. ;
  1. ; if no XMY is defined, MailMan should ask for recipients
  1. D ^XMD
  1. ;
  1. K XMZ,XMTEXT,XMSUB,XMDUZ,BLRALL,BLRANN,DIR,Y,^TMP($J,"BLRAMSG")
  1. ;
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. WP ; Using FileMan word-processing, add additional comments
  1. S DWLW=75,DWPK=1,DIC="^BLRALAB(9009027.1,"_DUZ_",100,"
  1. D EN^DIWE
  1. ;
  1. Q
  1. ;
  1. REA ; Reassign a lab result to another participating provider
  1. ;
  1. ; Parameters
  1. ; BLRAFPH = The 'From Physician'
  1. ; BLRATPH = The 'To Physician'
  1. ; TERMDT = Termination Date
  1. ; BLRADATA = Lab ES data
  1. ; BLRARPHY = Responsible Physician
  1. ; BLRARFL = Result Status Flag
  1. ;
  1. S BLRAFPH=DUZ
  1. ;
  1. RTO S DIC("A")="Select PARTICIPATING PHYSICIAN reassigning this lab TO: "
  1. S DIC="^BLRALAB(9009027.1,",DIC(0)="AEMNZ" D ^DIC
  1. Q:Y<1 S BLRATPH=+Y
  1. S TERMDT=$$GET1^DIQ(200,BLRATPH,9.2,"I")
  1. I TERMDT'=""&(TERMDT'>DT) D EN^DDIOL("This provider has a termination date, please select another") G RTO
  1. ;
  1. D FILR
  1. K BLRAFPH,BLRATPH,TERMDT,Y,BLRADATA,BLRARPHY,BLRARFL
  1. ;
  1. Q
  1. ;
  1. FILR ;EP
  1. S BLRADATA=$G(^LR(LRDFN,LRSS,LRIDT,9009027))
  1. S BLRARPHY=$P(BLRADATA,U,2),BLRARFL=$P(BLRADATA,U)
  1. D KX^BLRALUT1
  1. ;
  1. S $P(BLRADATA,U,2)=BLRATPH
  1. S ^LR(LRDFN,LRSS,LRIDT,9009027)=BLRADATA
  1. S BLRARPHY=BLRATPH
  1. D SX^BLRALUT1
  1. Q