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

GMRCINC.m

Go to the documentation of this file.
  1. GMRCINC ;SLC/JFR - list incomplete IFC transactions ; 2/12/02 15:05
  1. ;;3.0;CONSULT/REQUEST TRACKING;**22**;DEC 27, 1997
  1. EN ; -- main entry point for GMRCIF INCOMPLETE TRANSACTION
  1. N DIR,X,Y,DIRUT,DIROUT
  1. S DIR(0)="PO^123:EMQ",DIR("A")="Select a consult request"
  1. S DIR("?")="Type in the number, date of request or patient name"
  1. S DIR("S")="I $D(^GMR(123.6,""AC"",+Y))"
  1. D ^DIR
  1. I $D(DIRUT) Q
  1. I '$D(^GMR(123,+Y,0)) D Q
  1. . W !,"There is no such consult request number"
  1. . K DIR S DIR(0)="E" D ^DIR
  1. S GMRCNUM=+Y
  1. D BLD(GMRCNUM)
  1. D EN^VALM("GMRC IF INCOMPLETE TRANSACTION")
  1. Q
  1. ;
  1. BLD(GMRCDA) ;get list of incomplete IF transactions for a consult #
  1. ; Input:
  1. ; GMRCDA = ien of consult from file 123
  1. ;
  1. ; Output:
  1. ; some kind of ^TMP( array
  1. N GMRCLOG,ACT,ENT,LINE
  1. S ACT=0
  1. F S ACT=$O(^GMR(123.6,"AC",GMRCDA,ACT)) Q:'ACT D
  1. . S ENT=$O(^GMR(123.6,"AC",GMRCDA,ACT,1,0)) Q:'ENT
  1. . S GMRCLOG(ACT)=ENT
  1. I '$O(GMRCLOG(0)) D Q
  1. .S ^TMP("GMRCINC",$J,1,0)="No incomplete transactions for request #"_GMRCDA
  1. S GMRCLOG=GMRCLOG($O(GMRCLOG(0)))
  1. D EN^GMRCIERR(GMRCLOG,GMRCDA,$O(GMRCLOG(0)),1)
  1. M ^TMP("GMRCINC",$J)=^TMP("GMRCIERR",$J)
  1. S ACT=0
  1. F S ACT=$O(GMRCLOG(ACT)) Q:'ACT D
  1. . K ^TMP("GMRCIERR",$J)
  1. . S LINE=$O(^TMP("GMRCINC",$J," "),-1)+1
  1. . D ACTLG^GMRCIERR(GMRCDA,ACT,GMRCLOG(ACT),.LINE)
  1. . I '$D(^TMP("GMRCIERR",$J)) Q
  1. . S ^TMP("GMRCINC",$J,"B",ACT)=$O(^TMP("GMRCIERR",$J,0))+1
  1. . S LINE=0 F S LINE=$O(^TMP("GMRCIERR",$J,LINE)) Q:'LINE D
  1. .. S ^TMP("GMRCINC",$J,LINE+1,0)=^TMP("GMRCIERR",$J,LINE,0)
  1. .. Q
  1. . Q
  1. K ^TMP("GMRCIERR",$J)
  1. Q
  1. ;
  1. HDR ; -- header code
  1. S VALMHDR(1)="Incomplete transaction(s) for consult#: "_GMRCNUM
  1. Q
  1. ;
  1. INIT ; -- init variables and list array
  1. N ACT,LIN
  1. S VALMBG=1
  1. S VALMCNT=$O(^TMP("GMRCINC",$J," "),-1)
  1. S ACT=0 F S ACT=$O(^TMP("GMRCINC",$J,"B",ACT)) Q:'ACT D
  1. . S LIN=^TMP("GMRCINC",$J,"B",ACT)
  1. . D CNTRL^VALM10(LIN,1,14,IORVON,IORVOFF)
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. HELP ; -- help code
  1. S X="?" D DISP^XQORM1 W !!
  1. Q
  1. ;
  1. EXIT ; -- exit code
  1. K GMRCNUM,GMRCSEL
  1. K ^TMP("GMRCINC",$J),^TMP("GMRCS",$J)
  1. Q
  1. ;
  1. NEWCSLT ; pick new consult number to check for inc. trans.
  1. N DIR,DIRUT,DUOUT,DTOUT,DIROUT,X,Y
  1. D FULL^VALM1
  1. S DIR(0)="PO^123:EMQ",DIR("A")="Select a new Consult number"
  1. S DIR("?")="Type in the number, date of request or patient name"
  1. D ^DIR
  1. I $D(DIRUT) Q
  1. I '$D(^GMR(123,+Y,0)) D Q
  1. . W !,"There is no such consult request number"
  1. . K DIR S DIR(0)="E" D ^DIR
  1. K ^TMP("GMRCINC",$J),^TMP("GMRCS",$J)
  1. S GMRCNUM=+Y
  1. I '$D(GMRCSEL) D
  1. . D BLD(GMRCNUM)
  1. . D INIT
  1. . D HDR
  1. E D
  1. . S GMRCSEL=GMRCNUM
  1. . K GMRCLOG
  1. . D BLD^GMRCITR(GMRCNUM)
  1. . I '$O(GMRCLOG(0)) D
  1. .. S ^TMP("GMRCINC",$J,1,0)="No transactions for consult#: "_GMRCNUM
  1. . E D
  1. .. D DATA^GMRCITR(GMRCS)
  1. . D HDR^GMRCITR,LM^GMRCITR
  1. S VALMCNT=$O(^TMP("GMRCINC",$J," "),-1)
  1. S VALMBG=1
  1. Q
  1. ;
  1. RETRAN ;resend a particular transaction
  1. N DIR,DIRUT,DUOUT,DTOUT,DIROUT,X,Y,GMRCACT
  1. D FULL^VALM1
  1. S GMRCACT=$$SELACT(GMRCNUM) I 'GMRCACT Q
  1. I $O(^GMR(123.6,"AC",GMRCNUM,GMRCACT),-1)>0 D Q
  1. . W !!,"There is at least one earlier incomplete transaction for this"
  1. . W !,"consult, all incomplete transactions should be processed in "
  1. . W !,"order.",!
  1. . S DIR(0)="E" D ^DIR
  1. W !
  1. S DIR(0)="YA"
  1. S DIR("A")="Are you sure you want to retransmit this activity? "
  1. S DIR("A",1)="You have selected the following activity:"
  1. S DIR("A",2)=$$GET1^DIQ(123.1,$P(^GMR(123,GMRCNUM,40,GMRCACT,0),U,2),.01)_" entered "_$$FMTE^XLFDT($P(^GMR(123,GMRCNUM,40,GMRCACT,0),U))
  1. S DIR("A",3)=" "
  1. D ^DIR
  1. I +Y'=1 Q
  1. D DELALRT^GMRCIBKG($O(^GMR(123.6,"AC",GMRCNUM,GMRCACT,1,0)))
  1. D TRIGR^GMRCIEVT(GMRCNUM,GMRCACT)
  1. S VALMBG=1
  1. Q
  1. ;
  1. SELACT(GMRCDA) ;select an incomplete activity
  1. N DIR,DIRUT,DUOUT,DTOUT,DIROUT,X,Y,GMRC40
  1. S DIR(0)="N",DIR("A")="Select an activity number" D ^DIR
  1. I $D(DIRUT) Q ""
  1. S GMRC40=+Y
  1. K DIR
  1. I '$D(^GMR(123,GMRCDA,40,GMRC40)) D Q ""
  1. . W !,"There is no such activity number for consult# "_GMRCNUM
  1. . S DIR(0)="E" D ^DIR
  1. I '$D(^GMR(123.6,"AC",GMRCDA,GMRC40)) D Q ""
  1. . W !,"There is no incomplete IFC transaction for that activity"
  1. . S DIR(0)="E" D ^DIR
  1. Q GMRC40
  1. ;
  1. MKCOMP ; mark a particular transaction complete
  1. N DIR,DIRUT,DUOUT,DTOUT,DIROUT,X,Y,GMRCACT,FDA,GMRCLOG,GMRCERR
  1. D FULL^VALM1
  1. S GMRCACT=$$SELACT(GMRCNUM) I 'GMRCACT Q
  1. W !
  1. S DIR(0)="YA"
  1. S DIR("A")="Are you sure you want to mark this activity complete? "
  1. S DIR("A",1)="You have selected the following activity:"
  1. S DIR("A",2)=$$GET1^DIQ(123.1,$P(^GMR(123,GMRCNUM,40,GMRCACT,0),U,2),.01)_" entered "_$$FMTE^XLFDT($P(^GMR(123,GMRCNUM,40,GMRCACT,0),U))
  1. S DIR("A",3)=" "
  1. S DIR("A",4)="Use Caution marking a transaction complete!"
  1. S DIR("A",5)=" "
  1. D ^DIR
  1. I +$G(Y)'=1 Q
  1. S GMRCLOG=$O(^GMR(123.6,"AC",GMRCNUM,GMRCACT,1,0))
  1. I 'GMRCLOG Q
  1. S FDA(1,123.6,GMRCLOG_",",.06)="@"
  1. D UPDATE^DIE("","FDA(1)",,"GMRCERR")
  1. K ^TMP("GMRCINC",$J),^TMP("GMRCS",$J)
  1. D BLD(GMRCNUM)
  1. D INIT
  1. S VALMBG=1
  1. Q