2.0P171294BMI PERCENTILEC0QRMBMI2871931989
18.
; Call doesn't work for anybody above 18 yo.
I $T(BMIPCTL^TMGGRC1)']"" S NFOUND=0 QUIT
I PXRMAGE>18 S NFOUND=0 QUIT
;
; Get BMIs from Standard Reminders Call (added in Patch 12)
D BMI^PXRMBMI(DFN,NGET,BDT,EDT,.NFOUND,.TEST,.DATE,.DATA,.TEXT) ; BMI call
;
; Walk through BMI results
N IND ; Index
F IND=1:1:NFOUND D Q:'NFOUND ; If NFOUND is zero'ed, quit.
. ;
. ; S TEST(IND)=1,DATE(IND)=TDATE ; The same; won't set here.
. ; S TEXT(IND)="height measured "_$$EDATE^PXRMDATE(HDATE) ; the same
. N BMI S BMI=DATA(IND,"VALUE") ; Get BMI
. N PBMI ; BMI Percentile
. ; We use PXRMDATE API to grab the Reminders Date Due, not today's date.
. N AGE S AGE=$$FMDIFF^XLFDT($$NOW^PXRMDATE(),PXRMDOB,1)/365.24 ; Age in yrs
. ;
. ; If the ep exists, call it, otherwise, mark as not found.
. S PBMI=$$BMIPCTL^TMGGRC1(AGE,PXRMSEX,BMI,1)
. ;
. ; Also, if N/A (patient above 18 yo) - mark as not found.
. I PBMI["N/A" S NFOUND=0 QUIT ; Not available for anybody above 18 yo.
. ;
. ; We get a textish result (e.g. 78th percentile); convert to number
. S PBMI=+PBMI
. ;
. ; Set return values (NB: BMI subscript is still there)
. S (DATA(IND,"VALUE"),DATA(IND,"BMI%ILE"))=PBMI
QUIT
;
TPBMI(DFN) ; Test PBMI; Pass DFN by Value; Private, for testing only
N NFOUND,TEST,DATE,DATA,TEXT
N PXRMSEX S PXRMSEX=$P(^DPT(DFN,0),U,2)
N PXRMDOB S PXRMDOB=$P(^DPT(DFN,0),U,3)
N PXRMAGE S PXRMAGE=$$GET1^DIQ(2,DFN,"AGE")
D PBMI^C0QRMBMI(DFN,99,3000000,$$DT^XLFDT(),.NFOUND,.TEST,.DATE,.DATA,.TEXT)
I 'NFOUND W "No results found! for DFN "_DFN,!! QUIT
;
W "Patient: DFN: "_DFN_"; "_PXRMAGE_" yo; "_PXRMSEX,!
;
N I F I=1:1:NFOUND D
. W "NFOUND: "_NFOUND,!
. W "TEST: "_TEST(I),!
. W "DATE: "_DATE(I),!
. W "TEXT: "_TEXT(I),!
. W "DATA VALUE: "_DATA(I,"VALUE"),!
. W "DATA BMI%ILE: "_DATA(I,"BMI%ILE"),!
. W "DATA BMI: "_DATA(I,"BMI"),!
. W !
QUIT
;
; Private below as well.
TEST N DFN S DFN=0 F S DFN=$O(^DPT(DFN)) Q:'DFN D TPBMI(DFN) ; One liner test
QUIT
]]>
PXRMPDEM3829238928
0 S VALUE("DECEASED")=1,TEXT="Patient is deceased"
I '$D(PXRMPDEM) D
. N DOB,DOD
.;DBIA #10035
. S DOB=$P(^DPT(DFN,0),U,3)
. S DOD=$P($G(^DPT(DFN,.35)),U,1)
. S VALUE=$$AGE^PXRMAGE(DOB,DOD,$$NOW^PXRMDATE)
. I +DOD=0 S VALUE("DECEASED")=0 Q
. I +DOD>0 S VALUE("DECEASED")=1,TEXT="Patient is deceased"
Q
;
;======================================================
DFA(DFN,NGET,BDT,EDT,NFOUND,TEST,DATE,VALUE,TEXT) ;This computed finding
;returns the date the patient turns a specified age. Based on
;work by AJM: 9/16/08.
;DBIA #10035 DATE OF BIRTH is a required field.
I TEST="" S NFOUND=0,DATE(1)=$$NOW^PXRMDATE,TEST(1)=0 Q
S TEST=$P(TEST,".",1)
N DOB,YOB
S NFOUND=1
S DOB=$S($D(PXRMDOB):PXRMDOB,1:$P(^DPT(DFN,0),U,3))
S YOB=$E(DOB,1,3)
S (DATE(1),VALUE(1,"VALUE"))=YOB+TEST_$E(DOB,4,7)
S TEST(1)=1
S TEXT(1)="Patient "_$S(DATE(1)>$$NOW^PXRMDATE:"will be ",1:"was ")_+TEST_" years old on "_$$FMTE^XLFDT(DATE(1),"5Z")
Q
;
;======================================================
DOB(DFN,TEST,DATE,VALUE,TEXT) ;Computed finding for a patient's
;date of birth.
I $D(PXRMPDEM) S VALUE=PXRMPDEM("DOB")
;DBIA #10035 DATE OF BIRTH is a required field.
I '$D(PXRMPDEM) S VALUE=$P(^DPT(DFN,0),U,3)
S TEST=$S(VALUE<$$NOW^PXRMDATE:1,1:0)
I TEST S DATE=VALUE,TEXT=$$EDATE^PXRMDATE(VALUE)
Q
;
;======================================================
DOD(DFN,TEST,DATE,VALUE,TEXT) ;Computed finding for a patient's
;date of death.
I $D(PXRMPDEM) S VALUE=+PXRMPDEM("DOD")
;DBIA #10035
I '$D(PXRMPDEM) S VALUE=+$P($G(^DPT(DFN,.35)),U,1)
S TEST=$S(VALUE=0:0,VALUE>$$NOW^PXRMDATE:0,1:1)
I TEST S DATE=VALUE,TEXT=$$EDATE^PXRMDATE(VALUE)
Q
;
;======================================================
EMPLOYE(DFN,NGET,BDT,EDT,NFOUND,TEST,DATE,VALUE,TEXT) ;This computed finding
;will return true if the patient is an employee.
;DBIA #10035, #10060
N IEN,PAID,SSN
S NFOUND=1,DATE(1)=$$NOW^PXRMDATE,TEST(1)=0
S SSN=$P($G(^DPT(DFN,0)),U,9)
I SSN="" Q
;Use SSN to make the link.
S IEN=+$O(^VA(200,"SSN",SSN,""))
I IEN=0 Q
S PAID=+$P($G(^VA(200,IEN,450)),U,1)
I PAID=0 Q
;Check for a termination date.
I +$P(^VA(200,IEN,0),U,11)0,DDATE'EDT S NFOUND=NFOUND+1,DDATEL(DDATE,NFOUND)=^DGPT(IEN,0)
I NFOUND=0 Q
S SDIR=$S(NGET<0:1,1:-1)
S NGET=$S(NGET<0:-NGET,1:NGET)
S (DONE,NF)=0
S DDATE=""
F IND=1:1:NFOUND Q:DONE D
. S DDATE=$O(DDATEL(DDATE),SDIR)
. I DDATE="" S DONE=1 Q
. S IEN=0
. F S IEN=$O(DDATEL(DDATE,IEN)) Q:(IEN="")!(DONE) D
.. S FEEBASIS=$P(DDATEL(DDATE,IEN),U,4)
.. I FEEBASIS=1,'INFEE Q
..;Type 1 is PTF, Type 2 is Census
.. S TYPE=$P(DDATEL(DDATE,IEN),U,11)
.. I TYPE=2,'INCEN Q
.. S NF=NF+1
.. S TEST(NF)=1,(DATE(NF),VALUE(NF))=DDATE
.. I FEEBASIS=1 S TEXT(NF)="Fee basis"
.. I TYPE=2 S TEXT(NF)="Census"
.. I NF=NGET S DONE=1
S NFOUND=NF
Q
;
;======================================================
INP(DFN,NGET,BDT,EDT,NFOUND,TEST,DATE,VALUE,TEXT) ;Computed finding for
;determining if a patient is an inpatient on the evaluation date.
N VAIN,VAINDT
S NFOUND=1
S (DATE(1),VAINDT)=$$NOW^PXRMDATE
D INP^VADPT
I VAIN(1)="" S TEST(1)=0 D KVA^VADPT Q
S TEST(1)=1
S VALUE(1,"PRIMARY PROVIDER")=$P(VAIN(2),U,2)
S VALUE(1,"TREATING SPECIALTY")=$P(VAIN(3),U,2)
S VALUE(1,"WARD LOCATION")=$P(VAIN(4),U,2)
S VALUE(1,"ADMISSION DATE/TIME")=$P(VAIN(7),U,1)
S VALUE(1,"ADMISSION TYPE")=$P(VAIN(8),U,2)
S VALUE(1,"ATTENDING PHYSICIAN")=$P(VAIN(11),U,2)
S TEXT(1)="Patient is an inpatient; admission date/time: "_$$FMTE^XLFDT(VALUE(1,"ADMISSION DATE/TIME"),"5Z")
D KVA^VADPT
Q
;
;======================================================
NEWRACE(DFN,NGET,BDT,EDT,NFOUND,TEST,DATE,VALUE,TEXT) ;Computed finding
;for returning a patient's multi-valued race.
N CNT,CNT1,IND,VADM
D DEM^VADPT
I $D(VADM(12))'=11 S NFOUND=0 D KVA^VADPT Q
S NGET=$S(NGET<0:-NGET,1:NGET)
S (CNT,CNT1)=0
F S CNT=$O(VADM(12,CNT)) Q:(CNT="")!(CNT1=NGET) D
. S CNT1=CNT1+1,TEST(CNT1)=1,DATE(CNT1)=$$NOW^PXRMDATE
. S TEXT(CNT1)="",VALUE(CNT1,"VALUE")=$P($G(VADM(12,CNT)),U,2)
F CNT=1:1:CNT1 F IND=1:1:CNT1 S VALUE(CNT,"RACE",IND)=VALUE(IND,"VALUE")
S NFOUND=CNT1
D KVA^VADPT
Q
;
;======================================================
PATTYPE(DFN,TEST,DATE,VALUE,TEXT) ;Computed finding to return the patient
;type
N VAEL
S VALUE=""
S DATE=$$NOW^PXRMDATE
D ELIG^VADPT
S TEST=$S($G(VAEL(6))'="":1,1:0)
S VALUE=$P(VAEL(6),U,2)
D KVA^VADPT
Q
;======================================================
RACE(DFN,TEST,DATE,VALUE,TEXT) ;Computed finding for checking a patient's race.
N RACE
S DATE=$$NOW^PXRMDATE
;DBIA #10035
S RACE=$P($G(^DPT(DFN,0)),U,6)
I RACE="" S TEST=0,VALUE="" Q
Q
;
;======================================================
SEX(DFN,TEST,DATE,VALUE,TEXT) ;Computed finding for returning a patient's
;sex.
S DATE=$$NOW^PXRMDATE,TEST=1
I $D(PXRMPDEM) S VALUE=PXRMPDEM("SEX") Q
;DBIA #10035 SEX is a required field.
I '$D(PXRMPDEM) S VALUE=$P(^DPT(DFN,0),U,2)
Q
;
;======================================================
WASINP(DFN,NGET,BDT,EDT,NFOUND,TEST,DATE,VALUE,TEXT) ;Computed finding for
;determining if a patient was an inpatient in the period defined
;by BDT and EDT.
;Access to DGPM covered by DBIA #1378
N ADATE,ADM,ADML,DDATE,IEN,INDT,FDATE,LOS,NOCC,SDIR,TEMP
S FDATE=$S(TEST="DISCH":"DISCH",1:"ADM")
S SDIR=$S(NGET<0:1,1:-1)
S NOCC=$S(NGET<0:-NGET,1:NGET)
S NFOUND=0
;Use the "ATID3" index to build a last of past admissions and
;discharges.
S INDT=""
F S INDT=$O(^DGPM("ATID3",DFN,INDT)) Q:INDT="" D
. S IEN=$O(^DGPM("ATID3",DFN,INDT,""))
. S TEMP=^DGPM(IEN,0)
. S DDATE=$P(TEMP,U,1)
. S ADM=$P(TEMP,U,14)
. S ADATE=$P(^DGPM(ADM,0),U,1)
. I $$OVERLAP^PXRMINDX(ADATE,DDATE,BDT,EDT)'="O" Q
. S ADML(ADATE)=DDATE
;Check for the last admission and add it if it is not on the list.
S INDT=$O(^DGPM("ATID1",DFN,""))
I INDT'="" D
. S IEN=$O(^DGPM("ATID1",DFN,INDT,""))
. S TEMP=^DGPM(IEN,0)
. S ADATE=$P(TEMP,U,1)
. I $D(ADML(ADATE)) Q
. S IEN=$P(TEMP,U,17)
.;Since this is the last admission there may not be a discharge.
. S DDATE=$S(IEN="":$$NOW^PXRMDATE,1:$P(^DGPM(IEN,0),U,1))
. I $$OVERLAP^PXRMINDX(ADATE,DDATE,BDT,EDT)="O" S ADML(ADATE)=DDATE
;Sort the list.
S ADATE=""
F S ADATE=$O(ADML(ADATE),SDIR) Q:(NFOUND=NOCC)!(ADATE="") D
. S NFOUND=NFOUND+1
. S TEST(NFOUND)=1
. S DDATE=ADML(ADATE)
. I DDATE="" S DDATE=PXRMDATE
. S DATE(NFOUND)=$S(FDATE="DISCH":DDATE,1:ADATE)
. S LOS=$$FMDIFF^XLFDT(DDATE,ADATE)
. S TEMP="Inpatient from: "_$$FMTE^XLFDT(ADATE,"5Z")_" to "
. S TEMP=TEMP_$S(DDATE=PXRMDATE:"now",1:$$FMTE^XLFDT(DDATE,"5Z"))
. S TEMP=TEMP_"; Length of stay "_LOS_" days."
. S TEXT(NFOUND)=TEMP
. S VALUE(NFOUND,"ADMISSION DATE")=ADATE
. S VALUE(NFOUND,"DISCHARGE DATE")=DDATE
. S VALUE(NFOUND,"LENGTH OF STAY")=LOS
Q
;
]]>
GMRV VITAL TYPE120.51WEIGHT93151076501NOGMRV VITAL TYPE120.51HEIGHT81230056667NOREMINDER COMPUTED FINDINGS811.4VW-BMI-PERCENTILE991440960318NO
25";
3) This finding will be evaluated to true for patients with a BMI
percentile that is greater than 25.
This is a multi-occurrence computed finding.
811.4;+99,;5~MULTIPLE
811.4;+99,;100~LOCAL
811.42;+100,+99,;.01~07/31/2012@17:49:43
811.42;+100,+99,;2~WP-start~1
Exchange Stub
]]>
REMINDER COMPUTED FINDINGS811.4VA-AGE24697429304NO
50.
If the patient is deceased the age will be their age on the date of
death and V("DECEASED")=1.
811.4;+24,;5~SINGLE
811.4;+24,;100~NATIONAL
811.42;+25,+24,;.01~07/31/2012@17:49:43
811.42;+25,+24,;2~WP-start~1
Exchange Stub
]]>
REMINDER TAXONOMY811.2MU NQF0024 PHYSICAL 943603119878NOREMINDER TAXONOMY811.2MU NQF0024 NUTRITION 932397086677NOREMINDER TAXONOMY811.2MU NQF0024 BMI 2-17 ENC922269080646NOREMINDER TERM811.5MU NQF0024 BMI PERCENTILE5573836857714NOREMINDER TERM811.5MU NQF0024 AGE 2-10Y CF6143325321741NO
1
811.52;+615,+614,;22~I V>1
811.52;+616,+614,;.01~CF.VA-AGE
811.52;+616,+614,;14~I V<11
811.52;+616,+614,;22~I V<11
811.53;+617,+614,;.01~07/31/2012@17:49:45
811.53;+617,+614,;2~WP-start~1
Exchange Stub
]]>
REMINDER TERM811.5MU NQF0024 AGE 11-17 CF6153216234137NO
10
811.52;+616,+615,;22~I V>10
811.52;+617,+615,;.01~CF.VA-AGE
811.52;+617,+615,;14~I V<18
811.52;+617,+615,;22~I V<18
811.53;+618,+615,;.01~07/31/2012@17:49:45
811.53;+618,+615,;2~WP-start~1
Exchange Stub
]]>
REMINDER DEFINITION811.9MU NQF0024 BMI 2-17 YRS NUMER LIST147513139047NOREMINDER DEFINITION811.9MU NQF0024 DEM LIST 1742973718776NOREMINDER DEFINITION811.9MU NQF0024 BMI 2-10Y DENOM LIST1781607351926NOREMINDER DEFINITION811.9MU NQF0024 BMI 11-17Y DENOM LIST1803614933919NOREMINDER LIST RULE810.4MU NQF0024 BMI PERCENTILE FR1632662505972NOREMINDER LIST RULE810.4MU NQF0024 AGE 2-10 YEARS FR161935747946NOREMINDER LIST RULE810.4MU NQF0024 BMI 2-17 YR NUM RR773961334217NOREMINDER LIST RULE810.4MU NQF0024 BMI PERCENTILE 2-10Y RS1643870950224YESREMINDER LIST RULE810.4MU NQF0024 AGE 11-17 YRS FR1621569720012NOREMINDER LIST RULE810.4MU NQF0024 BMI PERCENTILE 11-17Y RS1652293356593YESREMINDER LIST RULE810.4MU NQF0024 BMI 2-17YRS RR75735094804NOREMINDER LIST RULE810.4MU NQF0024 BMI 2-17YRS DEM RS761395388539YESREMINDER LIST RULE810.4MU NQF0024 BMI 2-17YR NUM RS78463614337YESREMINDER LIST RULE810.4MU NQF0024 BMI 2-10Y DENOM RR1963130960392NOREMINDER LIST RULE810.4MU NQF0024 BMI 2-10Y DENOM RS1991432334213YESREMINDER LIST RULE810.4MU NQF0024 11-17Y DENOM RR197412521237NOREMINDER LIST RULE810.4MU NQF0024 BMI 11-17Y DENOM RS1982948743680YES2924992910334710836036035137337336441038637741541544342841944844847046145247747551149048152251658853552660659362461961063062965364363466065868367366469068877370369479277883380579684083888185384488888692990189293693495594994096096097997396498498410039979881008100810351021101210431040106210561047106710671094108010711102109911211115110611261126114711391130115311521180116611571188118512071201119212121212123312251216123912381258125212431263126312841276126712901289