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

BQIWHPRF.m

Go to the documentation of this file.
BQIWHPRF ;VNGT/HS/ALA-Women's Health Brief Profile ; 29 Apr 2010  5:38 PM
 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
 ;
 Q
 ;
EN(DATA,DFN) ; EP -- BQI WOMENS HEALTH PROFILE
 ;Description
 ;  Generates a Brief Women's Health Profile
 ;
 ;Input
 ;  DFN - Patient Internal ID
 ;
 NEW UID,X,BQII,HSTEXT,HSPATH,HSFN,Y,IOSL,IOST,IOM,BWACC,BWACCP,BWBNEED,BWCHRT,I
 NEW BWCMGR,BWCNEED,BWCRT,BWD,BWDATE,BWDATE1,BWDFN,BWDIAG,BWEDC,BWERRORS,BWIEN,M
 NEW BWNAMAGE,BWNAME,BWPAGE,BWPAPRG,BWPCD,BWPOP,BWPROV,BWSTAT,BWSUBH,BWTAB,BWTITLE
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("BQIWHPRF",UID))
 K @DATA
 ;
 S BQII=0
 ;
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIWHPRF D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S IOSL=999,IOM=80,IOST="P-OTHER80"
 S IOST(0)=$$FIND1^DIC(3.2,,"X",IOST)
 ;
 I $P($G(^DPT(DFN,0)),U,2)'="F" D  Q
 . S @DATA@(BQII)="I00010RESULT^T00080MESSAGE"_$C(30)
 . S BQII=BQII+1,@DATA@(BQII)="-1^RPC Failed: Patient is not Female"_$C(30)
 . S BQII=BQII+1,@DATA@(BQII)=$C(31)
 I $G(^BWP(DFN,0))="" D  Q
 . S @DATA@(BQII)="I00010RESULT^T00080MESSAGE"_$C(30)
 . S BQII=BQII+1,@DATA@(BQII)="-1^RPC Failed: Patient is not in the Women's Health file"_$C(30)
 . S BQII=BQII+1,@DATA@(BQII)=$C(31)
 ;
 D HDR
 ;
 I $$TMPFL^BQIUL1("W",UID,DFN) G DONE
 ;
 S BWDFN=DFN
 S BWERRORS=0,BWD=0,BWPAGE=0,BWCRT=1,BWTAB=5
 S BWTITLE="* * *  WOMEN'S HEALTH: PATIENT PROFILE  * * *"
 D SORT^BWPROF2
 D COPYGBL^BWPROF
 S N=0,BWPOP=0
 U IO D DISPLAY
 U IO W $C(9)
 D DISPLAY
 ;
 I $$TMPFL^BQIUL1("C") G DONE
 I $$TMPFL^BQIUL1("R",UID,DFN) G DONE
 ;
 F  U IO R HSTEXT:.1 Q:HSTEXT[$C(9)  D
 . S HSTEXT=$$STRIP^XLFSTR(HSTEXT,"^")
 . I HSTEXT="" S HSTEXT=" "
 . S BQII=BQII+1,@DATA@(BQII)=HSTEXT_$C(13)_$C(10)
 S BQII=BQII+1,@DATA@(BQII)=$C(30)
 ;
 I $$TMPFL^BQIUL1("C") G DONE
 I $$TMPFL^BQIUL1("D",UID,DFN) G DONE
 ;
DONE ;
 ;
 S BQII=BQII+1,@DATA@(BQII)=$C(31)
 Q
 ;
HDR ;
 S @DATA@(BQII)="T01024REPORT_TEXT"_$C(30)
 Q
 ;
ERR ;
 D ^%ZTER
 NEW Y,ERRDTM
 S Y=$$NOW^XLFDT() X ^DD("DD") S ERRDTM=Y
 S BMXSEC="Recording that an error occurred at "_ERRDTM
 I $D(BQII),$D(DATA) S BQII=BQII+1,@DATA@(BQII)=$C(31)
 I $$TMPFL^BQIUL1("C")
 Q
 ;
DISPLAY ; Copied and modified from BWPROF3
 S BWSUBH="SUBHEAD^BWPROF1"
 D HEADER2^BWUTL7
 S N=0
 F  S N=$O(^TMP("BW",$J,2,N)) Q:'N!(BWPOP)  D
 .S Y=^TMP("BW",$J,2,N),M=N
 .;---> QUIT IF NOT A PROCEDURE (PIECE 1'=1).
 .Q:$P(Y,U)'=1
 .W ! W:BWCRT $J(N,3),")" W ?BWTAB          ;BROWSE SELECTION#
 .W $P(Y,U,4)                               ;DATE OF PROCEDURE
 .W ?17,$P(Y,U,5)                           ;PROCEDURE ABBREVIATION
 .W ?27,$P(Y,U,7)                           ;RESULT
 .W ?71,$P(Y,U,9)                           ;STATUS
 .S BWACCP=$P(Y,U,6)                        ;STORE AS PREVIOUS ACCESS#
END2 ;EP
 ;W:'BWCRT @IOF
 ;---> IF A PROCEDURE HAS BEEN EDITED, SET N=N-1 AND START (GOTO)
 ;---> DISPLAY2 OVER AGAIN FROM 5 RECORDS PREVIOUS.
 ;I BWCRT&('$D(IO("S")))&('BWPOP) D DIRPRMT^BWUTL3 I N S N=N-1 G NOMATCH
 ;D ^%ZISC:'$G(BWEXT) ;IHS/CMI/THL PATCH 8 DON'T CLOSE WHEN EXTERNAL CALL
 K N,Z
 Q