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

GMPLMGR2.m

Go to the documentation of this file.
  1. GMPLMGR2 ; ISL/MKB,KER,AJB - Problem List VALM Utilities cont ;08/17/12 16:55
  1. ;;2.0;Problem List;**26,28,36**;Aug 25, 1994;Build 65
  1. ;
  1. ; External References
  1. ; DBIA 3990 $$ICDDX^ICDCODE
  1. ; DBIA 872 ^ORD(101
  1. ; DBIA 10026 ^DIR
  1. ; DBIA 10116 $$SETFLD^VALM1
  1. ; DBIA 10116 CLEAR^VALM1
  1. ; DBIA 10140 EN^XQORM
  1. ;
  1. BLDPROB(IFN) ; Build Line for Problem in List
  1. ; Input INF Pointer to Problem file 9000011
  1. ; Expects GMPCOUNT
  1. N GMPL0,GMPL1,GMPL800,RESOLVED,TEXT,I,LINE,STR,SC,SP,ICD,ONSET,PROBLEM,STATUS,SCTC
  1. Q:'$D(GMPCOUNT) S GMPL0=$G(^AUPNPROB(IFN,0)),GMPL1=$G(^(1)),GMPL800=$G(^(800)) Q:'$L(GMPL0)
  1. S ICD=$P($$ICDDX^ICDCODE(+GMPL0),U,2),SCTC=$P(GMPL800,U)
  1. S SC=$P(GMPL1,U,10),SP=$P(GMPL1,U,11,13)_"^"_$P(GMPL1,U,15,16),STATUS=$P(GMPL0,U,12)
  1. S:$P(GMPL1,U,2)="H" PROBLEM="< DELETED >" I $P(GMPL1,U,2)'="H" D
  1. . S PROBLEM=$$PROBTEXT^GMPLX(IFN),ONSET=$P(GMPL0,U,13)
  1. . I ONSET S PROBLEM=PROBLEM_", Onset "_$$EXTDT^GMPLX(ONSET)
  1. S RESOLVED=$J($$EXTDT^GMPLX($P(GMPL1,U,7)),8)
  1. S GMPCOUNT=GMPCOUNT+1
  1. D WRAP^GMPLX(PROBLEM,40,.TEXT)
  1. S LINE=$$SETFLD^VALM1(GMPCOUNT,"","NUMBER")
  1. ; added for Code Set Versioning (CSV) - checks ICD code - # if inactive
  1. I '$$CODESTS^GMPLX(IFN,DT) D
  1. . I STATUS="A" S LINE=$$SETFLD^VALM1(" #",LINE,"STATUS")
  1. . I STATUS="I" S LINE=$$SETFLD^VALM1(STATUS_"#",LINE,"STATUS")
  1. E S:STATUS="I" LINE=$$SETFLD^VALM1(STATUS,LINE,"STATUS")
  1. ; S:STATUS="I" LINE=$$SETFLD^VALM1(STATUS,LINE,"STATUS")
  1. S LINE=$$SETFLD^VALM1(TEXT(1),LINE,"PROBLEM")
  1. S LINE=$$SETFLD^VALM1(ICD,LINE,"ICD")
  1. I $L(SC) D
  1. . S STR=$S(+SC:"YES",SC=0:"NO",1:" ")
  1. . S LINE=$$SETFLD^VALM1(STR,LINE,"SERV CONNECTED")
  1. I $L(SP) D
  1. . S STR=$S(+$P(SP,U):"Agent Orange",+$P(SP,U,2):"Radiation",+$P(SP,U,3):"Contaminants",+$P(SP,U,4):"Head/Neck Cancer",+$P(SP,U,5):"Mil Sexual Trauma",1:"")
  1. . S LINE=$$SETFLD^VALM1(STR,LINE,"EXPOSURE")
  1. S LINE=$$SETFLD^VALM1(RESOLVED,LINE,"RESOLVED")
  1. S VALMCNT=VALMCNT+1,^TMP("GMPL",$J,VALMCNT,0)=LINE
  1. S ^TMP("GMPLIDX",$J,GMPCOUNT)=VALMCNT_U_IFN
  1. I TEXT>1 F I=2:1:TEXT D
  1. . S LINE="",LINE=$$SETFLD^VALM1(TEXT(I),LINE,"PROBLEM")
  1. . S VALMCNT=VALMCNT+1,^TMP("GMPL",$J,VALMCNT,0)=LINE
  1. Q
  1. ;
  1. HELP ; Help Code
  1. N X W !!?4,"You may take a variety of actions from this prompt. To update"
  1. W !?4,"the problem list select from Add, Remove, Edit, Inactivate,"
  1. W !?4,"and Enter Comment; you will then be prompted for the problem"
  1. W !?4,"number. To see all of this patient's problems, both active and"
  1. W !?4,"inactive, select Show All Problems; select Print to print the"
  1. W !?4,"same complete list in a chartable format. To see a listing of"
  1. W !?4,"actions that facilitate navigating the list, enter '??'."
  1. W !!,"Press <return> to continue ... " R X:DTIME
  1. S VALMSG=$$MSG^GMPLX,VALMBCK=$S(VALMCC:"",1:"R")
  1. Q
  1. ;
  1. EXIT ; Exit Code
  1. I GMPARAM("PRT"),$D(GMPRINT) D AUTO
  1. K ^TMP("GMPL",$J),^TMP("GMPLIDX",$J)
  1. K XQORM("KEY","="),XQORM("XLATE")
  1. K GMPDFN,GMPROV,GMPLVIEW,GMPARAM,VALMBCK,VALMHDR,VALMCNT,GMPCOUNT,GMPLUSER,GMPSC,VALMSG,GMPVAMC,GMPLIST,GMPAGTOR,GMPION,GMPGULF,GMPVA,GMPTOTAL,GMPRINT,AUPNSEX,GMPCLIN
  1. Q
  1. ;
  1. AUTO ; Print Problem List when Exiting Patient?
  1. ; Called from EXIT,NEWPAT^GMPLMGR1
  1. N DIR,X,Y,DUOUT,DTOUT Q:'GMPARAM("PRT") Q:'$D(GMPRINT)
  1. S DIR(0)="YA",DIR("A")="Print a new problem list? ",DIR("B")="YES"
  1. S DIR("?",1)="Press <return> to generate a new complete problem list for this patient;",DIR("?")="enter NO to continue without printing."
  1. W $C(7),!!,">>> THIS PATIENT'S PROBLEM LIST HAS CHANGED!"
  1. D ^DIR I $D(DTOUT)!($D(DTOUT)) S GMPQUIT=1 Q
  1. Q:'Y D VAF^GMPLPRNT,DEVICE^GMPLPRNT G:$D(GMPQUIT) AUTQ
  1. D CLEAR^VALM1,PRT^GMPLPRNT
  1. AUTQ ; Quit Auto-Print
  1. D KILL^GMPLX
  1. Q
  1. ;
  1. SHOW ; Show Current View of List
  1. N VIEW,NUM,NAME S VIEW=$E(GMPLVIEW("VIEW")),NUM=$L(GMPLVIEW("VIEW"),"/")
  1. W !!,"CURRENT VIEW: "_$S(VIEW="S":"Inpatient, ",1:"Outpatient, ")
  1. I '((NUM>2)!($L(GMPLVIEW("ACT")))!(GMPLVIEW("PROV"))) W "all problems" Q
  1. W $S(GMPLVIEW("ACT")="A":"active",GMPLVIEW("ACT")="I":"inactive",1:"all")_" problems"
  1. I NUM>2 W " from "_$S(GMPLVIEW("VIEW")=$$VIEW^GMPLX1(DUZ):"preferred",1:"selected")_$S(VIEW="S":" services",1:" clinics")
  1. I GMPLVIEW("PROV") S NAME=$$NAME^GMPLX1(GMPLVIEW("PROV")) W:($X+$L(NAME)+4>80) ! W " by "_NAME
  1. Q
  1. ;
  1. ENVIEW ; Entry Action to Display Appropriate View Menu
  1. N XQORM,X,Y,GMPLX S GMPLX=0 D SHOW S X="GMPL VIEW "_$S($E(GMPLVIEW("VIEW"))="S":"INPAT",1:"OUTPAT")
  1. S XQORM=+$O(^ORD(101,"B",X,0))_";ORD(101,",XQORM(0)="3AD"
  1. W !,"You may change your view of this patient's problem list by selecting one or",!,"more of the following attributes to alter:",!
  1. D EN^XQORM F S GMPLX=$O(Y(GMPLX)) Q:GMPLX'>0 X:$D(^ORD(101,+$P(Y(GMPLX),U,2),20)) ^(20)
  1. Q
  1. ;
  1. EXVIEW ; Exit Action to Rebuild List w/New View
  1. S VALMBCK=$S(VALMCC:"",1:"R") I '$D(GMPQUIT),$G(GMPREBLD) D
  1. . S VALMBG=1,VALMBCK="R" D GETPLIST^GMPLMGR1(.GMPLIST,.GMPTOTAL,.GMPLVIEW)
  1. . D BUILD^GMPLMGR(.GMPLIST),HDR^GMPLMGR
  1. K GMPQUIT,GMPREBLD S VALMSG=$$MSG^GMPLX
  1. Q