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

BHSPLST1.m

Go to the documentation of this file.
BHSPLST1 ;IHS/MSC/MGH  - Health Summary for Problem list;28-Apr-2016 14:48;DU
 ;;1.0;HEALTH SUMMARY COMPONENTS;**13**;Mar 17,2006;Build 6
 ; IHS/CMI/LAB - PART 4 OF APCHS -- SUMMARY PRODUCTION COMPONENTS ;31-Mar-2014 16:53;DU
 ;
PROB ; ******************** PROBLEM / NOTES * 9000011 *********
APROB S BHSTAT="ASEO" G COMMON
CPROB S BHSTAT="A" G COMMON
SPROB S BHSTAT="S" G COMMON
OPROB S BHSTAT="O" G COMMON
EPROB S BHSTAT="E" G COMMON
IPROB S BHSTAT="I" G COMMON
PPROB S BHSTAT="I",BHSPER=1
 ; <SETUP>
COMMON ;
 K BHSDFT S BHSNDF=0
 S BHSPER=$G(BHSPER)
 S BHSPAT=DFN
 S BHSFAC="" F BHSQ=0:0 S BHSFAC=$O(^AUPNPROB("AA",BHSPAT,BHSFAC)) Q:'BHSFAC  D PROBSCH
 D CKP^GMTSUP G:$D(GMTSQIT) PROBX I 'GMTSNPG W ! D CKP^GMTSUP G:$D(GMTSQIT) PROBX
 ; <DISPLAY>
 D CKP^GMTSUP Q:$D(GMTSQIT)
 W ?13,"ENT.       MODIFIED",!
 S BHSFPP="" F BHSQ=0:0 S BHSFPP=$O(BHSDFT(BHSFPP)) Q:BHSFPP=""!($D(GMTSQIT))  S BHSDFN=BHSDFT(BHSFPP) D PROBDSP
PROBX K BHSDFT,BHSNDF,BHSFPP,BHSFAC,BHSPLN,BHSPBN,BHSDTM,BHSDTN,BHSPRB,BHSTAT,BHSNFP,BHSNRQ,BHSPNM,BHSDFN,BHSFCN,BHSICD,BHSDOO
 K BHSICL,BHSILN,BHSN,BHSNAR,BHSNTE,BHSAX,BHSCL,BHSTXT,BHSQ,BHSICF,BHSP
 K BHSNFL,BHSNSH,BHSNAB,BHSVSC,BHSITE,Y,BHSVD,BHSX,BHSPAT,BHSPER,I,X
 Q
PROBSCH ;
 S BHSPRB="" F BHSQ=0:0 S BHSPRB=$O(^AUPNPROB("AA",BHSPAT,BHSFAC,BHSPRB)) Q:BHSPRB=""  D
 .S BHSDFN=$O(^(BHSPRB,""))
 .I BHSDFN'="" S BHSNAR=$$GET1^DIQ(9000011,BHSDFN,.05)
 .I BHSTAT[$P(^AUPNPROB(BHSDFN,0),U,12) D
 ..Q:BHSPER=1&($P(^AUPNPROB(BHSDFN,0),U,4)'="P")
 ..S BHSNDF=BHSNDF+1,BHSDFT(BHSNAR)=BHSDFN
 Q
PROBDSP ;
 ; <SETUP PROBLEM>
 S BHSNTE="",BHSDOO=""
 S BHSN=^AUPNPROB(BHSDFN,0)
 S BHSVD=$P(^AUPNPROB(BHSDFN,0),U,3)
 S BHSICD=$P(BHSN,U,1) D GETPLICD^BHSUTL
 S BHSNRQ=""
 S BHSNRQ=$$GET1^DIQ(9000011,BHSDFN_",",.05)
 S X=$$GET1^DIQ(9000011,BHSDFN_",",80001) I X]"" S BHSNRQ=BHSNRQ_" ("_X_")"
 S BHSITE=$P(BHSN,U,6) D GETSITE^BHSUTL
 S BHSPNM=$P(BHSN,U,7) ;***** EDE *****
 S BHSPNM=BHSNAB_BHSPNM ;***** EDE *****
 S X=$P(BHSN,U,3) D REGDT4^GMTSU  S BHSDTM=X
 S X=$P(BHSN,U,8) D REGDT4^GMTSU S BHSDTN=X
 S BHSCL=$$VAL^XBDIQ1(9000011,BHSDFN,.15)
 I BHSCL]"" S BHSNTE="  "_$$CAT^AUPNVPLC($P(BHSN,U,1))_":  "_BHSCL
 S X=$P(BHSN,U,13) I X]"" D REGDT4^GMTSU S BHSDOO=X
 S:BHSDOO]"" BHSNTE=BHSNTE_" (onset "_BHSDOO_")"
 S BHSNTE=BHSNTE_"(Status: "_$$VAL^XBDIQ1(9000011,BHSDFN,.12)_")"
 S BHSPLN=BHSPNM_$E("         ",1,10-$L(BHSPNM))_BHSDTN_" "_BHSDTM
 D CKP^GMTSUP Q:$D(GMTSQIT)  W:GMTSNPG ?12,"ENT.    MODIFIED",!
 W BHSPLN S BHSICL=33,BHSILN=50 D PRTICD^BHSUTL
 I $P(BHSN,U,16)!($P(BHSN,U,17))!($P(BHSN,U,18)) D ECODEDSP
 ;SEVERITY
 I $O(^AUPNPROB(BHSDFN,13,0)) D
 .W ?33,"Severity: "
 .S BHSAX=0 F  S BHSAX=$O(^AUPNPROB(BHSDFN,13,BHSAX)) Q:BHSAX'=+BHSAX  D
 ..S I=BHSAX_","_BHSDFN
 ..W ?42,$$GET1^DIQ(9000011.13,I,.01)_" - "_$$GET1^DIQ(9000011.13,I,.019),!
 ;FINDING SITE
 I $O(^AUPNPROB(BHSDFN,17,0)) D
 .W ?33,"Finding Site: "
 .S BHSAX=0 F  S BHSAX=$O(^AUPNPROB(BHSDFN,17,BHSAX)) Q:BHSAX'=+BHSAX  D
 ..S I=BHSAX_","_BHSDFN
 ..W ?42,$$GET1^DIQ(9000011.17,I,.01),!
 ;clinical course
 I $O(^AUPNPROB(BHSDFN,18,0)) D
 .W ?33,"Clinical Course: "
 .S BHSAX=0 F  S BHSAX=$O(^AUPNPROB(BHSDFN,18,BHSAX)) Q:BHSAX'=+BHSAX  D
 ..S I=BHSAX_","_BHSDFN
 ..W ?42,$$GET1^DIQ(9000011.18,I,.01)_" - "_$$GET1^DIQ(9000011.18,I,.019),!
 D NOTEDSP
 Q
ECODEDSP ;
 D CKP^GMTSUP Q:$D(GMTSQIT)
 W ?33,"CAUSE: ",!
 F BHSP=16,17,18 D  Q:$D(GMTSQIT)
 .D CKP^GMTSUP Q:$D(GMTSQIT)
 .W:GMTSNPG ?13,"ENT.       MODIFIED",!
 .S BHSTXT=""
 .S BHSICD=$P(BHSN,U,BHSP)
 .Q:BHSICD=""
 .S BHSNRQ=$S(BHSICF="N":$P($$ICDDX^ICDEX($P(BHSN,U,BHSP),"","","I"),U,4),BHSICF="L":$P($$ICDDX^AUPNVUTL($P(BHSN,U,BHSP)),U,4),1:"")
 .;D GETICDDX^BHSUTL
 . D GETPLICD^BHSUTL
 .I BHSICF="C"!(BHSICF="") S BHSNRQ=BHSICD_"-"_$P($$ICDDX^ICDEX($P(BHSN,U,BHSP),"","","I"),U,4)
 .I BHSICF="L" S BHSNRQ=BHSICD
 .S BHSICL=33,BHSILN=50
 .D PRTICDE^BHSUTL
 .Q
 Q
NOTEDSP ; DISPLAY NOTES UNDER APCHSPRBLEM
 S BHSNFP=0 F BHSQ=0:0 S BHSNFP=$O(^AUPNPROB(BHSDFN,11,BHSNFP)) Q:'BHSNFP  D DSPFACN
 Q
DSPFACN ; DISPLAY NOTES FOR SELECTED APSHCFACILITY
 Q:$D(^AUPNPROB(BHSDFN,11,BHSNFP,11,0))'=1  Q:$O(^(0))=""
 S BHSITE=^AUPNPROB(BHSDFN,11,BHSNFP,0) D GETSITE^BHSUTL S BHSFCN=BHSNAB
 S BHSNDF=0 F BHSQ=0:0 S BHSNDF=$O(^AUPNPROB(BHSDFN,11,BHSNFP,11,BHSNDF)) Q:'BHSNDF  S BHSN=^(BHSNDF,0) D DSPN
 Q
DSPN ; DISPLAY SINGLE NOTE
 N NTEDTE
 Q:$P(BHSN,U,4)="E"
 Q:$P(BHSN,U,4)="I"
 S BHSNAR=$P(BHSN,U,3) S X=$P(BHSN,U,5)
 I X>0 D REGDT4^GMTSU S NTEDTE=X
 F BHSQ=0:0 Q:$E(BHSFCN)'=" "  S BHSFCN=$E(BHSFCN,2,99)
 D CKP^GMTSUP Q:$D(GMTSQIT)  W "Note: "_BHSFCN_" "_$P(BHSN,U)_" on "_NTEDTE
 S BHSTXT=BHSNAR,BHSICL=34 D PRTTXT^BHSUTL
 Q