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