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

GMRCASF.m

Go to the documentation of this file.
  1. GMRCASF ;SLC/DLT - Significant Findings Action ;7/11/03 13:28
  1. ;;3.0;CONSULT/REQUEST TRACKING;**4,10,14,22,29,35,46**;DEC 27, 1997;Build 23
  1. SF(GMRCO) ;Evaluate Significant Findings and update accordingly
  1. ;GMRCO is the selected consult
  1. N GMRCQIT,GMRCLCK
  1. I '$L($G(GMRCO)) D SELECT^GMRCA2(.GMRCO) I $D(GMRCQUT) D END Q
  1. I '+($G(GMRCO)) D END Q
  1. I $P($G(^GMR(123,GMRCO,12)),U,5)="P" D Q
  1. . N DIR
  1. . W !,"The requesting facility may not take this action on an "
  1. . W "inter-facility consult."
  1. . S DIR(0)="E" D ^DIR
  1. . D END
  1. I '$$LOCK^GMRCA1(GMRCO) D END Q
  1. S GMRCLCK=1
  1. ;
  1. I $D(IOTM),$D(IOBM),$D(IOSTBM) D FULL^VALM1
  1. N GMRC,GMRCSTS,GMRCSF,GMRCSFO,GMRCORTX,GMRCDR
  1. S GMRC(0)=$G(^GMR(123,+GMRCO,0)) Q:GMRC(0)=""
  1. ;
  1. S GMRCSFO=$P(GMRC(0),"^",19)
  1. W !!,"Current Significant Findings = "_$S(GMRCSFO="U":"Unknown",GMRCSFO="Y":"Yes",GMRCSFO="N":"No",1:"not entered yet"),!!
  1. S GMRCSF=$$GETSIGF(GMRCSFO)
  1. I GMRCSF=0 D END Q
  1. ; If no change in old and new value ask if should continue
  1. I GMRCSF=GMRCSFO D I 'Y D END Q
  1. . W !,"The old and new Significant Findings are the same."
  1. . N DIR,DA,DTOUT,DUOUT,DIRUT,DIROUT
  1. . S DIR("A")="Do you want to proceed with this action"
  1. . S DIR(0)="Y"
  1. . S DIR("B")="NO"
  1. . D ^DIR
  1. . I $D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT) S Y=0 Q
  1. . I Y=0 Q
  1. ;
  1. ;Update last action and sig findings but don't change the status
  1. S GMRCSTS=$P(GMRC(0),"^",12),GMRCA=4
  1. S GMRCDR="8////^S X=GMRCSTS;9////^S X=GMRCA;15////^S X=GMRCSF"
  1. D STATUS^GMRCP
  1. I $G(GMRCERR)=1 S GMRCMSG=GMRCERMS D EXAC^GMRCADC(GMRCMSG),END Q
  1. ;
  1. ;GMRCOM=1 tells AUDIT^GMRCP to do the word-processing logic
  1. ;If an actual comment is added, $P(GMRCOM,"^",2)=1 (send alert),
  1. ; if not GMRCOM=1 and no '^' exists (do not send alert)
  1. S GMRCOM=1 D AUDIT^GMRCP
  1. I $G(GMRCERR)=1 S GMRCMSG=GMRCERMS D EXAC^GMRCADC(GMRCMSG),END Q
  1. ;
  1. I GMRCSTS=2 D EN^GMRCHL7($P(^GMR(123,GMRCO,0),U,2),GMRCO,$G(GMRCTYPE),$G(GMRCRB),"RE",GMRCORNP,$G(GMRCVSIT),,,$G(GMRCAD))
  1. D SETORTX
  1. I GMRCSTS=2 D SENDALRT(GMRCORTX) Q
  1. I +$P(GMRCOM,"^",2) D
  1. . W !,"An alert with the following text will be sent if recipients are selected: "
  1. . W !," "_GMRCORTX_$$ORTX^GMRCAU(+GMRCO)
  1. . W !
  1. . I GMRCSTS'=2 W !,"or the alert will be sent when the order is completed.",!
  1. . I $P($G(^GMR(123,GMRCO,12)),U,5)="F" D
  1. . W !!,"The ordering provider for this inter-facility consult will "
  1. . W "automatically be ",!,"notified.",!
  1. . D PROCALRT^GMRCACMT(GMRCORTX,1,4,GMRCO)
  1. . ;For consults not completed, the original provider may be deleted from
  1. . ;the recipient list for the alert.
  1. D END
  1. Q
  1. ;
  1. SETORTX ;Set prefix text for the alert
  1. S GMRCORTX=$S(GMRCSF="N":"No ",GMRCSF="Y":"",1:"Unknown ")
  1. S GMRCORTX=GMRCORTX_"Sig Findings for "_$P($G(^ORD(100.01,+GMRCSTS,0)),"^",2)_" consult " Q
  1. Q
  1. ;
  1. SENDALRT(GMRCORTX) ;Send to the requesting provider
  1. N GMRCRP,GMRCADUZ,GMRCDELR
  1. S GMRCRP=$P($G(^GMR(123,+GMRCO,0)),U,14) ;requesting clinician
  1. I +GMRCRP,GMRCRP'=DUZ D
  1. . S GMRCADUZ(+GMRCRP)=""
  1. . W !,"Alert will be sent to Requesting Provider: "_$P($G(^VA(200,+GMRCRP,0)),U,1)
  1. E W !,"No automatic alerts will be sent to the Requesting Provider."
  1. S GMRCDELR=0
  1. D ANDTO^GMRCACMT
  1. D SENDMSG^GMRCACMT(23,+GMRCO)
  1. ;Sig Findings uses the CONSULT/REQUEST RESOLUTION (23) notification
  1. Q
  1. ;
  1. GETSIGF(GMRCSFO) ;Get the significant findings
  1. ;GMRCSFO is the old significant findings value
  1. N DIR,DA,DTOUT,DUOUT,DIRUT,DIROUT
  1. S DIR(0)="123,15"
  1. S DIR("B")=GMRCSFO
  1. S:DIR("B")="" DIR("B")="unknown"
  1. S DIR("A")="Are there significant findings? (Y/N/U)"
  1. D ^DIR
  1. I $D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT) Q 0
  1. Q Y
  1. ;
  1. END ;cleanup variables
  1. I $G(GMRCLCK) D UNLOCK^GMRCA1(GMRCO)
  1. K GMRCO,GMRCA,GMRCMSG,GMRCOM,GMRCSEL,GMRCERR,GMRCERMS
  1. I $D(DTOUT)!$D(DIROUT) S GMRCQIT=""
  1. S:$D(^TMP("GMRC",$J,"CURRENT","MENU")) XQORM("HIJACK")=^("MENU")
  1. Q