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

GMRPNOR1.m

Go to the documentation of this file.
  1. GMRPNOR1 ;SLC/MKB/DJP Progress Note- OE/RR interface;; 2-14-97 ; 7-DEC-1999 12:10:24
  1. ;;2.5;Progress Notes;**25,45,50**;Jan 08, 1993
  1. ;
  1. ; this rtn is needed by TIU to support the one letter CWAD indicators
  1. ; in OE/RR 2.5 screens- subroutine CWAD
  1. ; DO NOT delete this rtn when the GMRP* rtns are deleted in the
  1. ; TIU clean-up
  1. ;
  1. SELPT ;select new patient using IN^OR to update ORVP, etc. GMRP*2.5*50
  1. ; IN^OR doesn't exist, code no longer used
  1. ;K DIC,Y,DIROUT S GMRPOLD=$G(ORVP)
  1. ;D IN^OR I $D(DIROUT) S GMRPEND=1 Q
  1. ;I (ORVP=GMRPOLD) S XQORM("B")="Redisplay Screen" K GMRPOLD Q
  1. ;K GMRPOLD D PAT Q:$D(GMRPQT) S:'$D(GMRPCTXT) GMRPCTXT=1
  1. ;D @("BUILD"_GMRPCTXT_"^GMRPNOR"),SCREEN^GMRPNOR
  1. ;Q
  1. PAT ;set up patient info for use - expects ORVP or DFN
  1. S GMRPDFN=$S($D(ORVP):$P(ORVP,";"),$D(DFN):DFN,1:0)
  1. I +GMRPDFN'>0 D Q:$D(GMRPQT)
  1. .S DIC="^DPT(",DIC(0)="AEQM" D ^DIC K DIC
  1. .I +Y<1 S GMRPQT=1 Q
  1. .S GMRPDFN=+Y
  1. N DFN S DFN=+GMRPDFN D OERR^VADPT
  1. S $P(GMRPDFN,U,2)=VADM(1),GMRPSSN=VA("PID")
  1. S GMRPDOB=VADM(3),GMRPAGE=VADM(4),GMRPRB=VAIN(5),GMRPLOC=$P(VAIN(4),U)
  1. S GMRPLOC=$P($G(^DIC(42,+GMRPLOC,44)),U)
  1. S:GMRPLOC>0 $P(GMRPLOC,U,2)=$P(^SC(+GMRPLOC,0),U)
  1. K VAIN,VADM,GMRPCWAD S GMRPCWAD=$$CWAD(GMRPDFN)
  1. Q
  1. CWAD(GMRPDFN) ;;check if any clinical warnings exist for patient
  1. ;Returns GMRPCWAD="CWAD" (for ones found), or "" if none
  1. ;S DFN (below) needed for hidden action CWAD^TIULX
  1. ; N GMRPCWAD,GMRPCWA1,TIUST,GMRPALG,GMRPI
  1. N GMRPCWA1,GMRPI
  1. I '+GMRPDFN Q ""
  1. S GMRPCWAD=""
  1. S GMRPCWA1=""
  1. F GMRPI=7,8 D
  1. . I $D(^TIU(8925,"ADCPT",+GMRPDFN,30,GMRPI)) S GMRPCWA1=GMRPCWA1_"C"
  1. . I $D(^TIU(8925,"ADCPT",+GMRPDFN,31,GMRPI)) S GMRPCWA1=GMRPCWA1_"W"
  1. . I $D(^TIU(8925,"ADCPT",+GMRPDFN,27,GMRPI)) S GMRPCWA1=GMRPCWA1_"D"
  1. . Q
  1. S DFN=GMRPDFN D ALLERGY^GMRPNCW I $D(GMRPALG) S GMRPCWA1=GMRPCWA1_"A"
  1. F GMRPI="C","W","D","A" D
  1. . I GMRPCWA1[GMRPI S GMRPCWAD=GMRPCWAD_GMRPI
  1. K CWA,TIUST,GMRPALG
  1. Q GMRPCWAD
  1. ;
  1. QUIT ;quits out of review screen
  1. S GMRPEND=1
  1. Q
  1. SEL ;selects single note from screen -- assumes GMRPN(GMRPNN) array
  1. S DIR(0)="NAO^1:"_GMRPNN,DIR("A")="Select a note: "
  1. S DIR("?")="Enter the display number of the note you wish to amend."
  1. S DIR("??")="^D HELPASK1^GMRPND" D ^DIR K DIR
  1. I $D(DTOUT)!($D(DIRUT))!($D(DIROUT)) S GMRPQT=1 Q
  1. S GMRPIFN=GMRPN(+Y)
  1. I $D(GMRPADDM),$P($G(^GMR(121,GMRPIFN,5)),U)=1 D Q
  1. .W !!,"This note requires a cosignature before it may be amended!"
  1. .W $C(7) S GMRPQT=1 K GMRPIFN
  1. D DISPL^GMRPN2 K:'$D(DIROUT)&('$D(DTOUT)) GMRPQT,DUOUT
  1. Q
  1. CURR ;Redisplay current screen -- needs GMRPPG & calls SCREEN
  1. I $S('$D(GMRPPG):1,GMRPPG'>0:1,1:0) S GMRPPG=1
  1. D SCREEN^GMRPNOR
  1. Q
  1. NEXT ;Display next screen -- needs GMRPPG & calls SCREEN
  1. I $S('$D(GMRPPG):1,GMRPPG'>0:1,1:0) S GMRPPG=1
  1. I GMRPPG<GMRPN("PG") S GMRPPG=GMRPPG+1
  1. D SCREEN^GMRPNOR
  1. Q
  1. PREV ;Display previous screen -- needs GMRPPG & calls SCREEN
  1. I $S('$D(GMRPPG):1,GMRPPG'>0:1,1:0) S GMRPPG=1
  1. I GMRPPG>1 S GMRPPG=GMRPPG-1
  1. D SCREEN^GMRPNOR
  1. Q
  1. CTXT ;Select new context for viewing/acting on notes
  1. ;Requires/Returns GMRPCTXT
  1. S DIR(0)="SAO^1:SIGNED;2:UNSIGNED;3:UNCOSIGNED;4:AUTHOR;5:DATES"
  1. S DIR("A")="Select context: ",DIR("A",1)="Valid selections are:"
  1. S DIR("A",2)=" 1 - signed notes (all) 2 - unsigned notes 3 - uncosigned notes"
  1. S DIR("A",3)=" 4 - signed notes/author 5 - signed notes/dates",DIR("A",4)=" "
  1. S DIR("?",1)="To change which notes are displayed, select the number"
  1. S DIR("?")="of the context you wish to work within.",DIR("B")="1"
  1. W ! D ^DIR K DIR S:$D(DIROUT) GMRPEND=1
  1. Q:$D(DUOUT)!($D(DTOUT))!($D(DIROUT))
  1. S GMRPSAV=Y D AUTHOR:Y=4,DATES^GMRPNP:Y=5 Q:$D(GMRPQT)
  1. S GMRPCTXT=GMRPSAV K GMRPBLD,GMRPSAV
  1. Q
  1. AUTHOR ;selects author - Returns GMRPDUZ=#^NAME or GMRPQT
  1. S DIC="^VA(200,",DIC(0)="AEQM",DIC("A")="Select AUTHOR: "
  1. S DIC("B")=$P(^VA(200,DUZ,0),U) D ^DIC K DIC
  1. I '$T!(+Y<1) S GMRPQT=1 S:$D(DIROUT) GMRPEND=1 Q
  1. S GMRPDUZ=Y K GMRPQT
  1. Q
  1. SETERM ;sets up GMRPTRML variable to hi-lite <CWAD> flag on review screen
  1. ;node 5 = inverse display, node 7 = highlighted display
  1. S GMRPTRML="" Q:'$D(IOST) Q:'$L(IOST)
  1. S X=$O(^%ZIS(2,"B",IOST,0))
  1. ;I X,$D(^%ZIS(2,X)) S GMRPTRML=$S($D(^(X,5)):$P(^(5),U,4,5),1:"")
  1. I X,$D(^%ZIS(2,X)) S GMRPTRML=$S($D(^(X,7)):$P(^(7),U,1,3),1:"")
  1. I S:'$L($P(GMRPTRML,U,3)) $P(GMRPTRML,U,3)=$P(GMRPTRML,U,2)
  1. F GMRPI=1,3 I '$L($P(GMRPTRML,U,GMRPI)) S GMRPTRML="" Q
  1. K GMRPI Q
  1. INV() I '$L(X) Q ""
  1. N DX,DY S DX=$X,DY=$Y W @X X ^%ZOSF("XY")
  1. Q ""
  1. UNSIGN ;entry point for follow-up action on unsigned pn's
  1. N ORVP S XQAKILL=0
  1. S GMRPCTXT=2,ORVP=$P($G(XQAID),",",2)_";DPT("
  1. S X=$O(^ORD(101,"B","GMRP REVIEW SCREEN",0))_";ORD(101," D EN^XQOR ;WPB/CAM REMOVE B START OF LINE
  1. Q
  1. COSIGN ;entry point for follow-up action on uncosigned pn's
  1. N ORVP S XQAKILL=0
  1. S GMRPCTXT=3,ORVP=$P($G(XQAID),",",2)_";DPT("
  1. S X=$O(^ORD(101,"B","GMRP REVIEW SCREEN",0))_";ORD(101," D EN^XQOR
  1. Q