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

BWMDE21.m

Go to the documentation of this file.
BWMDE21 ;IHS/ANMC/MWR - MDE FUNCTIONS. BWMDE2 CON'T;15-Feb-2003 21:58;PLS
 ;;2.0;WOMEN'S HEALTH;**5,7,8**;MAY 16, 1996
 ;;Modified for Y2K compliance       THL/HJT 5/14/99
 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
 ;;  CDC EXPORT, FUNCTIONS TO RETRIEVE DATA FOR INDIVIDUAL FIELDS
 ;;  FOR EXPORT.
 ;
 ;IHS/CMI/THL - CONTINUATION OF BWMDE2 - PATCH 7
 ;
MPREV() ;EP
 ;---> BUILD BW("MAM") ARRAY OF PREVIOUS MAMS.  RETURN 3 IF NONE.
 Q:'BWMAM 3
 N N,Y K BW("MAM") S N=0
 F  S N=$O(^BWPCD("C",BWDFN,N)) Q:'N  D
 .S Y=^BWPCD(N,0)
 .I $$PMAM^BWUTL6(+$P(Y,U,4)) D
 ..S BWMAMDT=$P(Y,U,12)
 ..Q:BWMAMDT'<$P(BW0,U,12)
 ..S BW("MAM",9999999-BWMAMDT)=BWMAMDT
 Q:$D(BW("MAM")) 1
 Q 3
 ;
MPREVDT() ;EP
 ;---> USE ABOVE BW("MAM") ARRAY TO RETURN DATE OF PREVIOUS MAM.
 Q:'BWMAM ""
 Q:'$D(BW("MAM")) ""
 N N
 S N=$O(BW("MAM",0))
 ;Begin Y2k fix
 ;I N S N=BW("MAM",N) K BW("MAM") Q $E(N,4,5)_$E(N,2,3)
 ;
 ;MOD PER THL 03/25/99 FOR CDC V4.0 AND Y2K COMPLIANCE
 ;
 I N S N=BW("MAM",N) K BW("MAM") Q $E(N,4,5)_($E(N,1,3)+1700)  ;Y2000
 ;
 ;END MOD PER THL 03/25/99 FOR CDC V4.0 AND Y2K COMPLIANCE
 ;End Y2k fix
 ;
 Q ""
 ;
MRESLT() ;EP
 ;---> IF THIS PCD IS NOT MAM:
 ;--->    RETURN 9 IF BR TX NEED=MAM AND DUE DATE IS BEFORE TODAY.
 ;--->    RETURN 8 IF BR TX NEED'=MAM, OR IF BR TX NEED=MAM BUT DUE DATE
 ;--->       IS AFTER TODAY.
 ;--->    BOTH CASES SET BWMABN=0 (ABNORMAL MAM=0).
 ;---> (BWMABN=0 WILL BLANK FILL ALL DATA IN ABNORMAL MAM SECTION.)
 ;
 I 'BWMAM S BWMABN=0 Q " 8"
 ;---> THIS PROCEDURE MUST BE A MAM.
 ;---> IF NO RESULT, RETURN 10 (RESULT PENDING) AND SET BWMABN=0.
 I 'BWRESN S BWMABN=0 Q 10
 ;---> RETURN THE CDC CODE FOR THE RESULT (PC 25).  IF RESULT IS 4,5,
 ;---> OR 6, SET BWMABN=1 TO EXTRACT DATA FOR ABNORMAL MAM SECTION.
 N X S X=$P(^BWDIAG(BWRESN,0),U,25)
 S BWMABN=$S(654[X:1,1:0)
 Q $J(X,2)
 ;
MWKUP() ;EP
 ;---> RETURN THE DX WORKUP: 1=PLANNED, 2=NOT PLANNED, 3=UNDETERMINED.
 Q:'BWMAM 2
 ;Q:'BWMABN 2
 N X
 S X=$P(BW2,U,20)
 Q:X X
 Q 2
 ;
MDT() ;EP
 ;---> DATE OF THIS MAMMOGRAM.
 Q:'BWMAM!'$P(BW0,U,12) ""
 N X
 S X=$$MRESLT
 Q:+X>7 ""
 Q:BWMAM $$CDCDT^BWMDE2($P(BW0,U,12))
 Q ""
 ;
MPAY() ;EP
 ;---> MAM PAID FOR BY COOP AGREEMENT FUNDS, 3=DON'T KNOW.
 Q:'BWMAM ""
 N X
 S X=$$MRESLT
 Q:+X>7 ""
 Q 1
BDXPAID() ;EP
 ;---> BREAST DX PAID FOR BY COOP AGREEMENT FUNDS, 3=DON'T KNOW.
 Q:'BWMAM ""
 N X S X=$$MRESLT
 Q:+X>7 ""
 Q:BWMAM 1
 Q ""
CBEPAID() ;EP
 ;---> CBE PAID FOR BY COOP AGREEMENT FUNDS, 3=DON'T KNOW.
 Q:'BWMAM ""
 N X
 S X=$$MRESLT
 Q:+X>7 ""
 Q:BWMAM 1
 Q ""
 ;
CDXPAID() ;EP
 ;---> CBE PAID FOR BY COOP AGREEMENT FUNDS, 3=DON'T KNOW.
 Q:'BWPAP ""
 I '$$CONOBX(),'$$COLPBX(),'$$POTHPR() Q ""
 Q 1
 ;
MDEVER() ;EP
 ;===> ANMC MODS BEGIN, IHS/ANMC/MWRZ  07/17/97
 ;Q 23
 ;Q 24  ;IHS/ANMC/MWRZ 07/17/97 ;CHANGE VERSION# FROM 23 TO 24.
 ;Q 40  ;IHS/CMI/THL 03/25/99 ;CHANGE VERSION# FROM 24 TO 40.
 Q 41  ;IHS/CMI/THL CHANGE VERSION# FROM 40 TO 41.
 ;===> ANMC MODS END, IHS/ANMC/MWRZ  07/17/97
 ;
CONOBX() ;EP
 ;---> COLP DONE WITHOUT BIOPSY.
 Q:'BWPABN ""
 Q:$$PWKUP>1 ""
 ;---> IF THERE IS AN ASSOCIATED COLP, BWC0=ZERO NODE OF THAT PCD.
 Q:BWC0']"" 2
 Q:$P(BWC0,U,26)="" 1
 Q 2
 ;
COLPBX() ;EP
 ;---> COLP DONE WITH BIOPSY.
 Q:'BWPABN ""
 Q:$$PWKUP>1 ""
 ;---> IF THERE IS AN ASSOCIATED COLP, BWC0=ZERO NODE OF THAT PCD.
 Q:BWC0']"" 2
 Q:$P(BWC0,U,26)]"" 1
 Q 2
 ;
POTHPR() ;EP
 ;---> OTHER PROCEDURES PERFORMED WITH THIS ABNORMAL PAP.
 Q:'BWPABN ""
 Q:$$PWKUP>1 ""
 Q:$P(BW2,U,21)]"" 1
 Q 2
 ;
POTHPR1() ;EP
 ;---> LIST OTHER PROCEDURES PERFORMED WITH THIS ABNORMAL PAP.
 Q:'BWPABN ""
 Q:$$PWKUP>1 ""
 Q $E($P(BW2,U,21),1,20)
 ;
POTHPR2() ;EP
 Q ""
 ;
PFNDX() ;EP
 ;---> FINAL DIAGNOSIS FOR ASSOCIATED COLP.
 ;---> FIRST TRY TO GET IT FROM #.33 FIELD; IF NOT, TRY ASSOC'D COLP.
 Q:'BWPABN ""
 Q:$$PWKUP>1 ""
 N X S X=$P(BW0,U,33)
 S:'X X=$P(BWC0,U,5)
 Q:'X ""
 Q:'$D(^BWDIAG(X,0)) ""
 Q $P(^BWDIAG(X,0),U,26)
 ;
PSTGDX() ;EP
 ;---> STAGE AT FINAL DIAGNOSIS.  GET FROM ASSOC'D COLP.
 Q:'BWPABN ""
 Q:$$PWKUP>1 ""
 Q:$$PFNDX()'=6 ""
 Q $P(BWC0,U,31)
 ;
PFNDXO() ;EP
 ;---> FREE TEXT DIAGNOSIS OF "OTHER" FOR ASSOC'D COLP.
 Q:'BWPABN ""
 Q:$$PWKUP>1 ""
 Q:$$PFNDX()'=7 ""
 N X S X=$P(BW0,U,33)
 S:'X X=$P(BWC0,U,5)
 Q:'X ""
 Q:'$D(^BWDIAG(X,0)) ""
 Q $E($P(^BWDIAG(X,0),U),1,20)
 ;
PSTFDX() ;EP
 ;---> PAP STATUS OF FINAL DX.
 Q:'BWPABN ""
 Q:$$PWKUP>1 ""
 Q $P(BW2,U,22)
 ;
PFDXDT() ;EP
 ;---> PAP DATE OF FINAL DX.
 Q:'BWPABN ""
 Q:$$PWKUP>1 ""
 Q $$CDCDT^BWMDE2($P(BW2,U,23))
 ;
PSTTX() ;EP
 ;---> STATUS OF TX.
 Q:'BWPABN ""
 Q:$$PWKUP>1 ""
 Q $P(BW2,U,24)
 ;
PSTXDT() ;EP
 ;---> DATE OF TX STATUS.
 Q:'BWPABN ""
 Q:$$PWKUP>1 ""
 Q $$CDCDT^BWMDE2($P(BW2,U,25))
 ;
MFUDXV() ;EP
 ;---> MAM FOLLOWUP DIAGNOSTIC VIEWW.
 ;Q:'BWMABN ""
 ;Q:$$MWKUP>1 ""
 Q $P(BW2,U,34)
 ;
MRBREX() ;EP
 ;---> MAM REPEAT BREAST EXAM.
 ;Q:'BWMABN ""
 ;Q:$$MWKUP>1 ""
 Q $P(BW2,U,26)
 ;
MULTRA() ;EP
 ;---> MAM ULTRASOUND.
 ;Q:'BWMABN ""
 ;Q:$$MWKUP>1 ""
 Q $P(BW2,U,27)
 ;
MLUMP() ;EP
 ;---> MAM BIOPSY/LUMPECTOMY.
 ;Q:'BWMABN ""
 ;Q:$$MWKUP>1 ""
 Q $P(BW2,U,28)
 ;
MFINDL() ;EP
 ;---> MAM FINE NEEDLE/CYST ASPIRATION.
 ;Q:'BWMABN ""
 ;Q:$$MWKUP>1 ""
 Q $P(BW2,U,29)
 ;
MOTHPR() ;EP
 ;---> MAM OTHER PROCEDURES PERFORMED WITH THIS ABNORMAL MAM.
 ;Q:'BWMABN ""
 ;Q:$$MWKUP>1 ""
 Q:$P(BW2,U,21)]"" 1
 Q 2
 ;
MOTHPR1() ;EP
 ;---> LIST OTHER PROCEDURES PERFORMED WITH THIS ABNORMAL PAP.
 ;Q:'BWMABN ""
 ;Q:$$MWKUP>1 ""
 Q:$P(BW2,U,21)]"" $E($P(BW2,U,21),1,20)
 Q ""
 ;
MOTHPR2() ;EP
 ;---> LIST MORE OTHER PROCEDURES PERFORMED WITH THIS ABNORMAL PAP.
 Q ""
 ;Q:'BWMABN ""
 ;
MFNDX() ;EP
 ;---> MAM FINAL DX.
 ;Q:'BWMABN ""
 ;Q:$$MWKUP>1 ""
 Q $P(BW2,U,30)
 ;
MSTGDX() ;EP
 ;---> MAM STAGE AT FINAL DX.
 ;Q:'BWMABN ""
 ;Q:$$MWKUP>1 ""
 Q $P(BW0,U,31)
 ;
MTMRSZ() ;EP
 ;---> MAM TUMOR SIZE.
 ;Q:'BWMABN ""
 ;Q:$$MWKUP>1 ""
 Q $P(BW2,U,31)
 ;
MSTFDX() ;EP
 ;---> MAM STATUS OF FINAL DX.
 ;Q:'BWMABN ""
 ;Q:$$MWKUP>1 ""
 Q $P(BW2,U,22)
 ;
MFDXDT() ;EP
 ;---> MAM DATE OF FINAL DX.
 ;Q:'BWMABN ""
 ;Q:$$MWKUP>1 ""
 Q:$P(BW2,U,23) $$CDCDT^BWMDE2($P(BW2,U,23))
 Q ""
 ;
MSTTX() ;EP
 ;---> MAM STATUS OF TX.
 ;Q:'BWMABN ""
 ;Q:$$MWKUP>1 ""
 Q $P(BW2,U,24)
 ;
MSTXDT() ;EP
 ;---> MAM DATE OF TX STATUS.
 ;Q:'BWMABN ""
 ;Q:$$MWKUP>1 ""
 Q:$P(BW2,U,25) $$CDCDT^BWMDE2($P(BW2,U,25))
 Q ""
 ;
EOR() ;EP
 Q ""
 ;
HRCN() ;
 ;---> APPEND HEALTH RECORD NUMBER FOR LOCAL PURPOSE.
 Q $$HRCN1^BWUTL1(BWDFN,DUZ(2))
PWKUP() ;EP
 ;---> RETURN THE DX WORKUP: 1=PLANNED, 2=NOT PLANNED, 3=UNDETERMINED.
 Q:'BWPAP 2
 ;IHS/CMI/THL 04/13/99 PATCH 7 TO RETURN CODE 3
 Q:$E($G(BWCDC(+$G(BWIEN))),107,108)=11 3
 Q:'BWPABN 2
 N X S X=$P(BW2,U,20)
 Q:(BWPAP&(X)) X
 Q 2
 ;