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

VENPCC1L.m

Go to the documentation of this file.
VENPCC1L ; IHS/OIT/GIS - VERSION 2.5 EXTENSIONS ;
 ;;2.6;PCC+;;NOV 12, 2007
 ;
 ; MORE SPECIAL DATA MINING FOR 2.5
 ;
VER25(DFN,PRV,VISIT,DEFEF,DEPTIEN) ; EP-EXTENSIONS FOR VER 2.5
 N TMP,PNL,%
 S PNL="LAB"_U
 S PNL=PNL_"VENPCC"
 S PNL="I $L($T("_PNL_"S6)) D "_PNL_"S6(DFN,DEFEF)"
 S TMP="^TMP(""VEN PRNT"",$J,1)"
CM D ACM(DFN) ; CASE MANAGEMENT FIELDS FOR VER 2.5
CC S %=$$CCTXT^VENPCCAM(VISIT) I $L(%) D CCMM(%) ; CHIEF COMPLAINT (c13) ; PATCHED BY GIS/OIT 7/21/06
MSR I $L($T(MSR^VENPCC1M)) D MSR^VENPCC1M(DFN,VISIT,DEFEF) ; MEASUREMENTS AND VITAL SIGNS FOR 2.5
AST I $L($T(RESP^VENPCC1M)),$D(^AUPNVAST("AC",DFN)) D RESP^VENPCC1M(DFN) ; ASTHMA MEASUREMENTS FOR 2.5
PNLAB I $P($G(^VEN(7.41,+$G(DEFEF),5)),U,22) X PNL I 1 ; SPECIAL PRENATAL LAB RESULTS DIAPLAY FOR VER 2.5
STDLAB E  I $O(^VEN(7.41,+$G(DEFEF),7,0)),$L($T(LAB^VENPCC1N)) D LAB^VENPCC1N(DFN,DEFEF) ; GENL LAB DISPLAY FOR 2.5
 I $D(^VEN(7.41,+$G(DEFEF),6)) X "I $L($T(GRAPH^VENPCCS3)) D GRAPH^VENPCCS3(DFN,DEFEF)" ; GRAPH RERSULTS VER 2.5
KB I $O(^VEN(7.41,+$G(DEFEF),16,0))!($O(^VEN(7.41,+$G(DEFEF),19,0))) X "I $L($T(FETCH^VENPCCK)) D FETCH^VENPCCK(DEFEF,DFN)" ; KNOWLEDGE BASE ; WCM UPGRADE
 Q
 ;
CCMM(Y) ; EP-NEW CHIEF COMPLAINT USES V NARRATIVE TEXT VALUE IN Y
 N I,X,MAX
 S MAX=$P($G(^VEN(7.41,DEFEF,14)),U,8)
 I 'MAX S MAX=240
 S Y=$E(Y,1,MAX)
 S @TMP@("c13")=$E(Y,1,240) ; STORED IN A GLOBAL SO LENGTH CANT BE > 240
 Q
 ; 
ACM(DFN) ; EP-CASE MGMT COMMEMTS
 N TOT,CIEN,RIEN,WIEN,CMT,REG,STG,%,X,Y,Z
 S TOT=19,RIEN=0
 F  S RIEN=$O(^ACM(41,"AC",DFN,RIEN)) Q:'RIEN  S CIEN=^(RIEN) I $O(^ACM(41,CIEN,1,0)) D
 . S STG="",WIEN=0
 . F  S WIEN=$O(^ACM(41,CIEN,1,WIEN)) Q:'WIEN  D  I $L(STG)>9999 Q  ; PATCHED BY GIS/OIT 10/3/05 ; PCC+ 2.5 PATCH 1
 .. S CMT=$G(^ACM(41,CIEN,1,WIEN,0)) I '$L(CMT) Q  ; COMMENT
 .. I '$L(STG) S STG=CMT Q
 .. S X=$E(STG,$L(STG)) S Y=$E(CMT) S Z=""
 .. I X'=" ",X'="-",Y'=" " S Z=" "
 .. S STG=STG_Z_CMT
 .. Q
 . I '$L(STG) Q
 . S REG=$P($G(^ACM(41.1,RIEN,0)),U) I '$L(REG) Q  ; REGISTER NAME
 . S STG=REG_": "_STG
 . F %=10,13,34,39,94 I STG[$C(%) S STG=$TR(STG,$C(%),"") ; STRIP OFF FORBIDDEN CHARACTERS
 . F  Q:'$L(STG)  S %=$E(STG,1,240) S STG=$E(STG,241,9999) S TOT=TOT+1 S @TMP@("u"_TOT)=%  I TOT>29 Q
 . Q
 Q
 ; 
ART(DFN) ; EP-ADVERSE REACTION TRACKING
 N MAXNARR,MAX,DATE,CAUSE,RXN,TOT,NARR,AIEN,RIEN,ORXN,RXNIEN,FMDT,STOP,X
 S STOP=0,TOT=0,MAX=$P($G(^VEN(7.41,+$G(DEFEF),2)),U,5) I 'MAX S MAX=5 ; MAX # OF ALLERGIES ALLOWED ON PCC+ FORM
 S MAXNARR=$P($G(^VEN(7.41,+$G(DEFEF),14)),U,6) I 'MAXNARR S MAXNARR=32 ; MAX STG LENGTH
 S AIEN=0 F  S AIEN=$O(^GMR(120.8,"B",DFN,AIEN)) Q:'AIEN  D  I STOP Q  ; LOOP THRU ART PATIENT INDEX
 . S X=$G(^GMR(120.8,AIEN,0)) I '$L(X) Q
 . I $D(^GMR(120.8,AIEN,"ER")) Q  ; RXN HAS BEEN REMOVED ; PATCHED BY GIS 12/26/06
 . S CAUSE=$P(X,U,2) I '$L(CAUSE) Q  ; GET REACTANT
 . S FMDT=$P(X,U,4),DATE="" ; GET DATE OF ADVERSE REACTION
 . I FMDT S DATE=$$FMTE^XLFDT(FMDT,"2D")
 . S RIEN=0,NARR=""
 . I '$O(^GMR(120.8,AIEN,10,0)) S NARR=CAUSE_": Reaction??" ; PATCHED BY GIS/OIT 6/6/06 ; PCC + VERSION 2.5, PATCH 5
 . F  S RIEN=$O(^GMR(120.8,AIEN,10,RIEN)) Q:'RIEN  D  ; GET INDIVIDUAL REACTIONS
 .. S Y=$G(^GMR(120.8,AIEN,10,RIEN,0)) I '$L(Y) Q
 .. S RXNIEN=+Y,ORXN=$P(Y,U,2)
 .. I $L(ORXN) S RXN=ORXN ; OTHER RXN
 .. E  S RXN=$P($G(^GMRD(120.83,RXNIEN,0)),U) ; STD REACTION FROM LIST
 .. I '$L(RXN) S RXN="Unknown reaction" ; PATCHED BY GIS/OIT 2/1/06 ; PCC + VERSION 2.5, PATCH 4
 .. I NARR="" S NARR=CAUSE_": "_RXN
 .. E  S NARR=NARR_","_RXN
 .. Q
 . I '$L(NARR) Q  ; THERE MUSTBE A LEAST 1 DOCUMENTED RXN
 . I $L(DATE) S NARR=NARR_" ("_DATE_")" ; APPEND THE DATE
 . S TOT=TOT+1
 . I TOT=(MAX+1) S STOP=1,@TMP@(1,("a"_MAX))="More allergies on Health Summary!" Q
 . S @TMP@(1,("a"_TOT))=$E(NARR,1,MAXNARR) ; CREATE MAIL MERGE GLOBAL NODE
 . Q
 Q
 ;