BIPATVW3 ;IHS/CMI/MWR - ADD OTHER ITEMS, DISPLAY HELP; MAY 10, 2010
 ;;8.5;IMMUNIZATION;**14**;AUG 01,2017
 ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
 ;;  BUILD LISTMANAGER ARRAY FOR DISPLAY AND EDIT OF
 ;;  PATIENT'S IMMUNIZATION DATA, DISPLAY HELP.
 ;;  PATCH 8: Changes to discontinue High Risk forecast for Flu  HADINFO+51,+56
 ;;  PATCH 9: Accommodate new parameter options for HepB (Diabetes).  ADDINFO+51
 ;;  PATCH 14: Code to collect High Risk Pneumo, HepB (DM), HepA&B (CLD/HepC) ADDINFO+64
 ;
 ;
 ;----------
LASTLET(BIDFN,BIRMAX,BIENT) ;EP
 ;---> Retrieve date of last letter sent to this patient and
 ;---> display it just below forecast.
 ;---> Parameters:
 ;     1 - BIDFN  (req) Patient's IEN in VA PATIENT File #2.
 ;     2 - BIRMAX (ret) Maximum Right column line number.
 ;     3 - BIENT  (ret) Entry Number for LM selection in VALMY
 ;
 ;---> Check for BIDFN.
 Q:$$DFNCHECK^BIUTL2()
 ;
 ;---> Call RPC to retrieve date of last letter sent.
 ;     BIRETVAL - Return value of valid data from RPC.
 ;     BIRETERR - Return value (text string) of error from RPC.
 ;
 N BIRETVAL,BIRETERR S BIRETVAL=""
 ;
 ;---> RPC to retrieve date of last letter sent.
 D LASTLET^BIRPC5(.BIRETVAL,BIDFN)
 ;
 ;---> If BIRETERR has a value, display it and quit.
 S BIRETERR=$P(BIRETVAL,BI31,2)
 I BIRETERR]"" D
 .D EN^DDIOL("* "_BIRETERR,"","!!?5"),DIRZ^BIUTL3()
 .S BIRETVAL="ERROR!"
 ;
 ;---> Set BIDATE=to date of last letter sent to this patient.
 N BIDATE S BIDATE=$P(BIRETVAL,BI31,1)
 ;
 ;---> Set formatted Last Letter Date line and index in ^TMP.
 D RTCOL^BIPATVW1(.BIRMAX,,BIENT)
 D RTCOL^BIPATVW1(.BIRMAX,"   Last Letter: "_BIDATE,BIENT)
 ;
 Q
 ;
 ;
 ;----------
CONTRAS(BIDFN,BILMAX,BIRMAX,BIENT) ;EP
 ;---> Now retrieve Patient's Contraindications and append to
 ;---> right half of screen, below Forecast.
 ;---> Parameters:
 ;     1 - BIDFN  (req) Patient's IEN in VA PATIENT File #2.
 ;     2 - BILMAX (ret) Maximum Left column line number.
 ;     3 - BIRMAX (ret) Maximum Right column line number.
 ;     4 - BIENT  (ret) Entry Number for LM selection in VALMY
 ;
 ;---> Check for BIDFN.
 Q:$$DFNCHECK^BIUTL2()
 ;
 ;---> Call RPC to retrieve Contraindications.
 ;     BIRETVAL - Return value of valid data from RPC.
 ;     BIRETERR - Return value (text string) of error from RPC.
 ;
 N BIRETVAL,BIRETERR S BIRETVAL=""
 ;
 ;---> RPC to retrieve Contraindications.
 D CONTRAS^BIRPC5(.BIRETVAL,BIDFN)
 ;
 ;---> If BIRETERR has a value, display it and quit.
 S BIRETERR=$P(BIRETVAL,BI31,2)
 I BIRETERR]"" D EN^DDIOL("* "_BIRETERR,"","!!?5"),DIRZ^BIUTL3() Q
 ;
 ;---> Set BICONT=to a string of Contraindications for this patient.
 N BICONT,BILINE S BICONT=$P(BIRETVAL,BI31,1)
 S BILINE=BIRMAX S:BILINE<1 BILINE=1
 ;
 ;---> Write Contraindications Header.
 D:BICONT]""
 .D RTCOL^BIPATVW1(.BILINE,,BIENT)
 .N X S X="-----------------------------------"
 .D RTCOL^BIPATVW1(.BILINE,X,BIENT)
 .D RTCOL^BIPATVW1(.BILINE,"   * CONTRAINDICATIONS/REFUSALS *",BIENT)
 .D RTCOL^BIPATVW1(.BILINE,,BIENT)
 ;
 ;---> Build Listmanager array from BICONT string.
 ;
 F I=1:1 S Y=$P(BICONT,U,I) Q:Y=""  D
 .;---> Build display line for this Contraindication.
 .N V S V="|"
 .;S X="  "_$P(Y,V,2)_":",X=$$PAD^BIUTL5(X,14)_$P(Y,V,3),X=$E(X,1,40)
 .S X="  "_$P(Y,V,2)_": "_$P(Y,V,3),X=$E(X,1,36)
 .;---> Set formatted Contraindication line and index in ^TMP.
 .D RTCOL^BIPATVW1(.BILINE,X,BIENT)
 ;
 ;---> Save maximum right column line number.
 S BIRMAX=BILINE
 Q
 ;
 ;
 ;----------
ADDINFO(BIDFN,BILINE,BIENT,BIDUZ2,BIFDT) ;EP
 ;---> Display Additional Information from Patient Edit screen.
 ;---> Parameters:
 ;     1 - BIDFN  (req) Patient's IEN in VA PATIENT File #2.
 ;     2 - BIRMAX (req) Last Line# (last node in ^TMP array).
 ;     3 - BIENT  (ret) Entry Number for LM selection in VALMY
 ;     5 - BIDUZ2 (req) DUZ(2) (for forecasting parameter display).
 ;     4 - BIFDT  (req) Forecast date (for High Risk display).
 ;
 ;---> Check for BIDFN.
 Q:$$DFNCHECK^BIUTL2()
 S:'$G(BIDUZ2) BIDUZ2=$G(DUZ(2))
 S:'$G(BIFDT) BIFDT=$G(DT)
 ;
 N X,Z S Z=BIENT
 D WRITE^BIPATVW1(.BILINE,,1,Z)
 D WRITE^BIPATVW1(.BILINE,"   ADDITIONAL PATIENT INFORMATION",,Z)
 D WRITE^BIPATVW1(.BILINE,"   ------------------------------",,Z)
 S X=$$DECEASED^BIUTL1(BIDFN,1)
 D:X
 .S X="   DECEASED on..........: "_$$TXDT1^BIUTL5(X)
 .D WRITE^BIPATVW1(.BILINE,X,,Z)
 I '$D(^BIP(BIDFN,0)) D  Q
 .S X="   This Patient is not in the Register."
 .D WRITE^BIPATVW1(.BILINE,X,1,Z)
 ;
 S X="   Case Manager.........: "_$$CMGR^BIUTL1(BIDFN,1)
 D WRITE^BIPATVW1(.BILINE,X,,Z)
 S X="   Designated Provider..: "_$$DPRV^BIUTL1(BIDFN,1)
 D WRITE^BIPATVW1(.BILINE,X,,Z)
 S X="   Parent/Guardian......: "_$$PARENT^BIUTL1(BIDFN)
 D WRITE^BIPATVW1(.BILINE,X,,Z)
 S X="   Current Community....: "_$$CURCOM^BIUTL11(BIDFN,1)
 D WRITE^BIPATVW1(.BILINE,X,,Z)
 S X="   Date First Entered...: "_$$ENTERED^BIUTL1(BIDFN,,1)
 S X=X_" ("_$$ENTERED^BIUTL1(BIDFN,1,1)_")"
 D WRITE^BIPATVW1(.BILINE,X,,Z)
 D
 .N Y S Y=$$INACT^BIUTL1(BIDFN,1)
 .Q:'Y
 .S X="   Inactive Date........: "_Y
 .I Z]"" S X=X_" (Reason: "_$$INACTRE^BIUTL1(BIDFN)_")"
 .D WRITE^BIPATVW1(.BILINE,X,,Z)
 .S X="   Made Inactive by.....: "_$$INACTUSR^BIUTL1(BIDFN)
 .D WRITE^BIPATVW1(.BILINE,X,,Z)
 ;
 S X=$$MOVEDLOC^BIUTL1(BIDFN)
 I X]"" S X="   Moved to/Tx Elsewhere: "_X D WRITE^BIPATVW1(.BILINE,X,,Z)
 S X="" D
 .Q:'$G(DT)  N BIRISKI,BIRISKP
 .;
 .;********** PATCH 9, v8.5, OCT 01,2014, IHS/CMI/MWR
 .;---> Accommodate new parameter options for HepB (Diabetes).
 .;---> Set risk parameter equal to 12 = Hep B & Pneumo (this is NOT forecasting,
 .;---> merely displaying Additional Patient Info).
 .N BIRSK,BIRISKH S BIRSK=12
 .;
 .;********** PATCH 8, v8.5, MAR 15,2014, IHS/CMI/MWR
 .;---> Collect only Pneumo High Risk.
 .;D RISK^BIDX(BIDFN,BIFDT,0,.BIRISKI,.BIRISKP)
 .;
 .;---> New parameter to return Hep B risk. (No longer include Flu.)
 .;D RISK^BIDX(BIDFN,BIFDT,2,.BIRISKI,.BIRISKP)
 .;
 .;********** PATCH 14, v8.5, AUG 01,2017, IHS/CMI/MWR
 .;---> Code to collect High Risk Pneumo, HepB (DM), HepA&B (CLD/HepC)
 .;D RISK^BIDX(BIDFN,BIFDT,BIRSK,,.BIRISKP,.BIRISKH)
 .;
 .;---> Set Patient Age in years for this Forecast Date.
 .N BIAGE S BIAGE=$$AGE^BIUTL1(BIDFN,1,BIFDT)
 .N BIRISKF S BIRISKF="",BIRSK=""
 .D RISKP^BIDX(BIDFN,BIFDT,BIAGE,1,.BIRISKF) S:BIRISKF BIRSK=BIRSK_1
 .D RISKB^BIDX(BIDFN,BIFDT,BIAGE,.BIRISKF) S:BIRISKF BIRSK=BIRSK_2
 .D RISKAB^BIDX(BIDFN,BIFDT,.BIRISKF) S:BIRISKF BIRSK=BIRSK_3
 .I 'BIRSK S X="None on record" Q
 .S X=$$RISKTX^BISITE1(BIRSK)
 S X="   High Risk Pneumo,Hep.: "_X
 ;**********
 ;
 S X=X_" (as of "_$$SLDT2^BIUTL5(BIFDT,1)_")"
 D WRITE^BIPATVW1(.BILINE,X,,Z)
 S X="   Forecast Flu/Pneumo..: "_$$INFL^BIUTL11(BIDFN,1)
 D WRITE^BIPATVW1(.BILINE,X,,Z)
 ;D:$G(BIDUZ2)  ;Uncomment to display Pneumo Site Parameter.
 ;.N X,Y,Z S X=$$PNMAGE^BIPATUP2(BIDUZ2)
 ;.S Y=$P(X,U),Z=$P(X,U,2)
 ;. X=Y_" years old, "_$S(Z:"every 6 years.",1:"one time only.")
 ;.S X="   Pneumo Site Parameter: Set at "_X
 ;.D WRITE^BIPATVW1(.BILINE,X,,Z)
 S X="   Mother's HBsAG Status: "_$$T^BITRS($$MOTHER^BIUTL11(BIDFN,1))
 D WRITE^BIPATVW1(.BILINE,X,,Z)
 S X=$$NEXTAPPT^BIUTL11(BIDFN)
 I ((X]"")&(X'="None")) S X="   Next Appointment.....: "_$E(X,1,54) D
 .D WRITE^BIPATVW1(.BILINE,X,,Z)
 D
 .N Y S Y=$$CONSENT^BIUTL1(BIDFN)
 .I Y=1 S X="Consented" Q
 .I Y=0 S X="Declined" Q
 .S X="Unknown"
 S X="   State Registry.......: "_X
 D WRITE^BIPATVW1(.BILINE,X,,Z)
 S X="   Other Information....: "_$$OTHERIN^BIUTL11(BIDFN)
 D WRITE^BIPATVW1(.BILINE,X,,Z)
 D WRITE^BIPATVW1(.BILINE,,,Z)
 Q
 ;
 ;
 ;----------
HELP ;EP
 ;----> Explanation of this report.
 N BITEXT D TEXT1(.BITEXT)
 D START^BIHELP("PATIENT VIEW SCREEN - HELP",.BITEXT)
 Q
 ;
 ;
 ;----------
TEXT1(BITEXT) ;EP
 ;;
 ;;This is the main Patient View Screen, the single point from
 ;;which you manage all of an individual patient's immunization data.
 ;;
 ;;The screen is divided horizontally into THREE SECTIONS:
 ;;
 ;;The TOP third of the screen lists the patient's demographic information,
 ;;most of which is edited through the RPMS Patient Registration.
 ;;
 ;;The MIDDLE third of the screen is subdivided into LEFT and RIGHT Columns:
 ;;
 ;;   The LEFT column lists the Patient's Immunization and Skin Test
 ;;   history, including adverse reactions.
 ;;
 ;;   The RIGHT column lists the patient's Immunizations Due, date of last
 ;;   letter sent to the patient, and any contraindications.
 ;;
 ;;The BOTTOM third of the screen lists Actions you can take to add or edit
 ;;the patient's immunization data, or to display other relevant patient
 ;;information.
 ;;
 ;;For many patients, there is more information than can be displayed
 ;;in the middle section of the screen.  To view all of the information
 ;;on a Patient's Immunization History it may be necessary to use the
 ;;"arrow keys" to scroll up and down.
 ;;
 ;;The Actions at the bottom of the screen are:
 ;;
 ;;  A  Add Immunization  - to add a new immunization
 ;;  D  Delete Visit      - to delete an immunization
 ;;  P  Patient Edit      - to edit patient guardian, inactive date, etc.
 ;;  S  Skin Test Add     - to add a skin test
 ;;  I  ImmServe Profile  - to view details of the forecast
 ;;  C  Contraindications - to add/edit/delete contraindications
 ;;  E  Edit Visit        - to change data of an immunization
 ;;  H  Health Summary    - to view the patient's Health Summary
 ;;  L  Letter Print      - to select and print a patient letter
 ;;
 ;;
 ;;There are also Hidden Actions, which you can review by typing ??
 ;;at the "Select Action:" prompt.  If you entered ??, the Hidden
 ;;Actions will be displayed in a list after this text.  Any of the
 ;;Hidden Actions can be executed by typing their names or synonyms
 ;;at the "Select Action:" prompt, just as with the primary Actions.
 ;;
 ;;NOTE! There are two ways to print a patient's Immunization History:
 ;;
 ;;      1) At the Select Action prompt enter "PL" or "Print List".
 ;;         This action will print or queue the entire Patient View Screen
 ;;         as it appears on your screen.
 ;;
 ;;  or  2) Enter "L" or "Letter Print" and select the "Official
 ;;         Immunization Record" for the form letter to print.
 ;;
 D LOADTX("TEXT1",,.BITEXT)
 Q
 ;
 ;
 ;----------
LOADTX(BILINL,BITAB,BITEXT) ;EP
 Q:$G(BILINL)=""
 N I,T,X S T="" S:'$D(BITAB) BITAB=5 F I=1:1:BITAB S T=T_" "
 F I=1:1 S X=$T(@BILINL+I) Q:X'[";;"  S BITEXT(I)=T_$P(X,";;",2)
 Q
BIPATVW3  ;IHS/CMI/MWR - ADD OTHER ITEMS, DISPLAY HELP; MAY 10, 2010
 +1       ;;8.5;IMMUNIZATION;**14**;AUG 01,2017
 +2       ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
 +3       ;;  BUILD LISTMANAGER ARRAY FOR DISPLAY AND EDIT OF
 +4       ;;  PATIENT'S IMMUNIZATION DATA, DISPLAY HELP.
 +5       ;;  PATCH 8: Changes to discontinue High Risk forecast for Flu  HADINFO+51,+56
 +6       ;;  PATCH 9: Accommodate new parameter options for HepB (Diabetes).  ADDINFO+51
 +7       ;;  PATCH 14: Code to collect High Risk Pneumo, HepB (DM), HepA&B (CLD/HepC) ADDINFO+64
 +8       ;
 +9       ;
 +10      ;----------
LASTLET(BIDFN,BIRMAX,BIENT) ;EP
 +1       ;---> Retrieve date of last letter sent to this patient and
 +2       ;---> display it just below forecast.
 +3       ;---> Parameters:
 +4       ;     1 - BIDFN  (req) Patient's IEN in VA PATIENT File #2.
 +5       ;     2 - BIRMAX (ret) Maximum Right column line number.
 +6       ;     3 - BIENT  (ret) Entry Number for LM selection in VALMY
 +7       ;
 +8       ;---> Check for BIDFN.
 +9        IF $$DFNCHECK^BIUTL2()
               QUIT 
 +10      ;
 +11      ;---> Call RPC to retrieve date of last letter sent.
 +12      ;     BIRETVAL - Return value of valid data from RPC.
 +13      ;     BIRETERR - Return value (text string) of error from RPC.
 +14      ;
 +15       NEW BIRETVAL,BIRETERR
           SET BIRETVAL=""
 +16      ;
 +17      ;---> RPC to retrieve date of last letter sent.
 +18       DO LASTLET^BIRPC5(.BIRETVAL,BIDFN)
 +19      ;
 +20      ;---> If BIRETERR has a value, display it and quit.
 +21       SET BIRETERR=$PIECE(BIRETVAL,BI31,2)
 +22       IF BIRETERR]""
               Begin DoDot:1
 +23               DO EN^DDIOL("* "_BIRETERR,"","!!?5")
                   DO DIRZ^BIUTL3()
 +24               SET BIRETVAL="ERROR!"
               End DoDot:1
 +25      ;
 +26      ;---> Set BIDATE=to date of last letter sent to this patient.
 +27       NEW BIDATE
           SET BIDATE=$PIECE(BIRETVAL,BI31,1)
 +28      ;
 +29      ;---> Set formatted Last Letter Date line and index in ^TMP.
 +30       DO RTCOL^BIPATVW1(.BIRMAX,,BIENT)
 +31       DO RTCOL^BIPATVW1(.BIRMAX,"   Last Letter: "_BIDATE,BIENT)
 +32      ;
 +33       QUIT 
 +34      ;
 +35      ;
 +36      ;----------
CONTRAS(BIDFN,BILMAX,BIRMAX,BIENT) ;EP
 +1       ;---> Now retrieve Patient's Contraindications and append to
 +2       ;---> right half of screen, below Forecast.
 +3       ;---> Parameters:
 +4       ;     1 - BIDFN  (req) Patient's IEN in VA PATIENT File #2.
 +5       ;     2 - BILMAX (ret) Maximum Left column line number.
 +6       ;     3 - BIRMAX (ret) Maximum Right column line number.
 +7       ;     4 - BIENT  (ret) Entry Number for LM selection in VALMY
 +8       ;
 +9       ;---> Check for BIDFN.
 +10       IF $$DFNCHECK^BIUTL2()
               QUIT 
 +11      ;
 +12      ;---> Call RPC to retrieve Contraindications.
 +13      ;     BIRETVAL - Return value of valid data from RPC.
 +14      ;     BIRETERR - Return value (text string) of error from RPC.
 +15      ;
 +16       NEW BIRETVAL,BIRETERR
           SET BIRETVAL=""
 +17      ;
 +18      ;---> RPC to retrieve Contraindications.
 +19       DO CONTRAS^BIRPC5(.BIRETVAL,BIDFN)
 +20      ;
 +21      ;---> If BIRETERR has a value, display it and quit.
 +22       SET BIRETERR=$PIECE(BIRETVAL,BI31,2)
 +23       IF BIRETERR]""
               DO EN^DDIOL("* "_BIRETERR,"","!!?5")
               DO DIRZ^BIUTL3()
               QUIT 
 +24      ;
 +25      ;---> Set BICONT=to a string of Contraindications for this patient.
 +26       NEW BICONT,BILINE
           SET BICONT=$PIECE(BIRETVAL,BI31,1)
 +27       SET BILINE=BIRMAX
           IF BILINE<1
               SET BILINE=1
 +28      ;
 +29      ;---> Write Contraindications Header.
 +30       IF BICONT]""
               Begin DoDot:1
 +31               DO RTCOL^BIPATVW1(.BILINE,,BIENT)
 +32               NEW X
                   SET X="-----------------------------------"
 +33               DO RTCOL^BIPATVW1(.BILINE,X,BIENT)
 +34               DO RTCOL^BIPATVW1(.BILINE,"   * CONTRAINDICATIONS/REFUSALS *",BIENT)
 +35               DO RTCOL^BIPATVW1(.BILINE,,BIENT)
               End DoDot:1
 +36      ;
 +37      ;---> Build Listmanager array from BICONT string.
 +38      ;
 +39       FOR I=1:1
               SET Y=$PIECE(BICONT,U,I)
               IF Y=""
                   QUIT 
               Begin DoDot:1
 +40      ;---> Build display line for this Contraindication.
 +41               NEW V
                   SET V="|"
 +42      ;S X="  "_$P(Y,V,2)_":",X=$$PAD^BIUTL5(X,14)_$P(Y,V,3),X=$E(X,1,40)
 +43               SET X="  "_$PIECE(Y,V,2)_": "_$PIECE(Y,V,3)
                   SET X=$EXTRACT(X,1,36)
 +44      ;---> Set formatted Contraindication line and index in ^TMP.
 +45               DO RTCOL^BIPATVW1(.BILINE,X,BIENT)
               End DoDot:1
 +46      ;
 +47      ;---> Save maximum right column line number.
 +48       SET BIRMAX=BILINE
 +49       QUIT 
 +50      ;
 +51      ;
 +52      ;----------
ADDINFO(BIDFN,BILINE,BIENT,BIDUZ2,BIFDT) ;EP
 +1       ;---> Display Additional Information from Patient Edit screen.
 +2       ;---> Parameters:
 +3       ;     1 - BIDFN  (req) Patient's IEN in VA PATIENT File #2.
 +4       ;     2 - BIRMAX (req) Last Line# (last node in ^TMP array).
 +5       ;     3 - BIENT  (ret) Entry Number for LM selection in VALMY
 +6       ;     5 - BIDUZ2 (req) DUZ(2) (for forecasting parameter display).
 +7       ;     4 - BIFDT  (req) Forecast date (for High Risk display).
 +8       ;
 +9       ;---> Check for BIDFN.
 +10       IF $$DFNCHECK^BIUTL2()
               QUIT 
 +11       IF '$GET(BIDUZ2)
               SET BIDUZ2=$GET(DUZ(2))
 +12       IF '$GET(BIFDT)
               SET BIFDT=$GET(DT)
 +13      ;
 +14       NEW X,Z
           SET Z=BIENT
 +15       DO WRITE^BIPATVW1(.BILINE,,1,Z)
 +16       DO WRITE^BIPATVW1(.BILINE,"   ADDITIONAL PATIENT INFORMATION",,Z)
 +17       DO WRITE^BIPATVW1(.BILINE,"   ------------------------------",,Z)
 +18       SET X=$$DECEASED^BIUTL1(BIDFN,1)
 +19       IF X
               Begin DoDot:1
 +20               SET X="   DECEASED on..........: "_$$TXDT1^BIUTL5(X)
 +21               DO WRITE^BIPATVW1(.BILINE,X,,Z)
               End DoDot:1
 +22       IF '$DATA(^BIP(BIDFN,0))
               Begin DoDot:1
 +23               SET X="   This Patient is not in the Register."
 +24               DO WRITE^BIPATVW1(.BILINE,X,1,Z)
               End DoDot:1
               QUIT 
 +25      ;
 +26       SET X="   Case Manager.........: "_$$CMGR^BIUTL1(BIDFN,1)
 +27       DO WRITE^BIPATVW1(.BILINE,X,,Z)
 +28       SET X="   Designated Provider..: "_$$DPRV^BIUTL1(BIDFN,1)
 +29       DO WRITE^BIPATVW1(.BILINE,X,,Z)
 +30       SET X="   Parent/Guardian......: "_$$PARENT^BIUTL1(BIDFN)
 +31       DO WRITE^BIPATVW1(.BILINE,X,,Z)
 +32       SET X="   Current Community....: "_$$CURCOM^BIUTL11(BIDFN,1)
 +33       DO WRITE^BIPATVW1(.BILINE,X,,Z)
 +34       SET X="   Date First Entered...: "_$$ENTERED^BIUTL1(BIDFN,,1)
 +35       SET X=X_" ("_$$ENTERED^BIUTL1(BIDFN,1,1)_")"
 +36       DO WRITE^BIPATVW1(.BILINE,X,,Z)
 +37       Begin DoDot:1
 +38           NEW Y
               SET Y=$$INACT^BIUTL1(BIDFN,1)
 +39           IF 'Y
                   QUIT 
 +40           SET X="   Inactive Date........: "_Y
 +41           IF Z]""
                   SET X=X_" (Reason: "_$$INACTRE^BIUTL1(BIDFN)_")"
 +42           DO WRITE^BIPATVW1(.BILINE,X,,Z)
 +43           SET X="   Made Inactive by.....: "_$$INACTUSR^BIUTL1(BIDFN)
 +44           DO WRITE^BIPATVW1(.BILINE,X,,Z)
           End DoDot:1
 +45      ;
 +46       SET X=$$MOVEDLOC^BIUTL1(BIDFN)
 +47       IF X]""
               SET X="   Moved to/Tx Elsewhere: "_X
               DO WRITE^BIPATVW1(.BILINE,X,,Z)
 +48       SET X=""
           Begin DoDot:1
 +49           IF '$GET(DT)
                   QUIT 
               NEW BIRISKI,BIRISKP
 +50      ;
 +51      ;********** PATCH 9, v8.5, OCT 01,2014, IHS/CMI/MWR
 +52      ;---> Accommodate new parameter options for HepB (Diabetes).
 +53      ;---> Set risk parameter equal to 12 = Hep B & Pneumo (this is NOT forecasting,
 +54      ;---> merely displaying Additional Patient Info).
 +55           NEW BIRSK,BIRISKH
               SET BIRSK=12
 +56      ;
 +57      ;********** PATCH 8, v8.5, MAR 15,2014, IHS/CMI/MWR
 +58      ;---> Collect only Pneumo High Risk.
 +59      ;D RISK^BIDX(BIDFN,BIFDT,0,.BIRISKI,.BIRISKP)
 +60      ;
 +61      ;---> New parameter to return Hep B risk. (No longer include Flu.)
 +62      ;D RISK^BIDX(BIDFN,BIFDT,2,.BIRISKI,.BIRISKP)
 +63      ;
 +64      ;********** PATCH 14, v8.5, AUG 01,2017, IHS/CMI/MWR
 +65      ;---> Code to collect High Risk Pneumo, HepB (DM), HepA&B (CLD/HepC)
 +66      ;D RISK^BIDX(BIDFN,BIFDT,BIRSK,,.BIRISKP,.BIRISKH)
 +67      ;
 +68      ;---> Set Patient Age in years for this Forecast Date.
 +69           NEW BIAGE
               SET BIAGE=$$AGE^BIUTL1(BIDFN,1,BIFDT)
 +70           NEW BIRISKF
               SET BIRISKF=""
               SET BIRSK=""
 +71           DO RISKP^BIDX(BIDFN,BIFDT,BIAGE,1,.BIRISKF)
               IF BIRISKF
                   SET BIRSK=BIRSK_1
 +72           DO RISKB^BIDX(BIDFN,BIFDT,BIAGE,.BIRISKF)
               IF BIRISKF
                   SET BIRSK=BIRSK_2
 +73           DO RISKAB^BIDX(BIDFN,BIFDT,.BIRISKF)
               IF BIRISKF
                   SET BIRSK=BIRSK_3
 +74           IF 'BIRSK
                   SET X="None on record"
                   QUIT 
 +75           SET X=$$RISKTX^BISITE1(BIRSK)
           End DoDot:1
 +76       SET X="   High Risk Pneumo,Hep.: "_X
 +77      ;**********
 +78      ;
 +79       SET X=X_" (as of "_$$SLDT2^BIUTL5(BIFDT,1)_")"
 +80       DO WRITE^BIPATVW1(.BILINE,X,,Z)
 +81       SET X="   Forecast Flu/Pneumo..: "_$$INFL^BIUTL11(BIDFN,1)
 +82       DO WRITE^BIPATVW1(.BILINE,X,,Z)
 +83      ;D:$G(BIDUZ2)  ;Uncomment to display Pneumo Site Parameter.
 +84      ;.N X,Y,Z S X=$$PNMAGE^BIPATUP2(BIDUZ2)
 +85      ;.S Y=$P(X,U),Z=$P(X,U,2)
 +86      ;. X=Y_" years old, "_$S(Z:"every 6 years.",1:"one time only.")
 +87      ;.S X="   Pneumo Site Parameter: Set at "_X
 +88      ;.D WRITE^BIPATVW1(.BILINE,X,,Z)
 +89       SET X="   Mother's HBsAG Status: "_$$T^BITRS($$MOTHER^BIUTL11(BIDFN,1))
 +90       DO WRITE^BIPATVW1(.BILINE,X,,Z)
 +91       SET X=$$NEXTAPPT^BIUTL11(BIDFN)
 +92       IF ((X]"")&(X'="None"))
               SET X="   Next Appointment.....: "_$EXTRACT(X,1,54)
               Begin DoDot:1
 +93               DO WRITE^BIPATVW1(.BILINE,X,,Z)
               End DoDot:1
 +94       Begin DoDot:1
 +95           NEW Y
               SET Y=$$CONSENT^BIUTL1(BIDFN)
 +96           IF Y=1
                   SET X="Consented"
                   QUIT 
 +97           IF Y=0
                   SET X="Declined"
                   QUIT 
 +98           SET X="Unknown"
           End DoDot:1
 +99       SET X="   State Registry.......: "_X
 +100      DO WRITE^BIPATVW1(.BILINE,X,,Z)
 +101      SET X="   Other Information....: "_$$OTHERIN^BIUTL11(BIDFN)
 +102      DO WRITE^BIPATVW1(.BILINE,X,,Z)
 +103      DO WRITE^BIPATVW1(.BILINE,,,Z)
 +104      QUIT 
 +105     ;
 +106     ;
 +107     ;----------
HELP      ;EP
 +1       ;----> Explanation of this report.
 +2        NEW BITEXT
           DO TEXT1(.BITEXT)
 +3        DO START^BIHELP("PATIENT VIEW SCREEN - HELP",.BITEXT)
 +4        QUIT 
 +5       ;
 +6       ;
 +7       ;----------
TEXT1(BITEXT) ;EP
 +1       ;;
 +2       ;;This is the main Patient View Screen, the single point from
 +3       ;;which you manage all of an individual patient's immunization data.
 +4       ;;
 +5       ;;The screen is divided horizontally into THREE SECTIONS:
 +6       ;;
 +7       ;;The TOP third of the screen lists the patient's demographic information,
 +8       ;;most of which is edited through the RPMS Patient Registration.
 +9       ;;
 +10      ;;The MIDDLE third of the screen is subdivided into LEFT and RIGHT Columns:
 +11      ;;
 +12      ;;   The LEFT column lists the Patient's Immunization and Skin Test
 +13      ;;   history, including adverse reactions.
 +14      ;;
 +15      ;;   The RIGHT column lists the patient's Immunizations Due, date of last
 +16      ;;   letter sent to the patient, and any contraindications.
 +17      ;;
 +18      ;;The BOTTOM third of the screen lists Actions you can take to add or edit
 +19      ;;the patient's immunization data, or to display other relevant patient
 +20      ;;information.
 +21      ;;
 +22      ;;For many patients, there is more information than can be displayed
 +23      ;;in the middle section of the screen.  To view all of the information
 +24      ;;on a Patient's Immunization History it may be necessary to use the
 +25      ;;"arrow keys" to scroll up and down.
 +26      ;;
 +27      ;;The Actions at the bottom of the screen are:
 +28      ;;
 +29      ;;  A  Add Immunization  - to add a new immunization
 +30      ;;  D  Delete Visit      - to delete an immunization
 +31      ;;  P  Patient Edit      - to edit patient guardian, inactive date, etc.
 +32      ;;  S  Skin Test Add     - to add a skin test
 +33      ;;  I  ImmServe Profile  - to view details of the forecast
 +34      ;;  C  Contraindications - to add/edit/delete contraindications
 +35      ;;  E  Edit Visit        - to change data of an immunization
 +36      ;;  H  Health Summary    - to view the patient's Health Summary
 +37      ;;  L  Letter Print      - to select and print a patient letter
 +38      ;;
 +39      ;;
 +40      ;;There are also Hidden Actions, which you can review by typing ??
 +41      ;;at the "Select Action:" prompt.  If you entered ??, the Hidden
 +42      ;;Actions will be displayed in a list after this text.  Any of the
 +43      ;;Hidden Actions can be executed by typing their names or synonyms
 +44      ;;at the "Select Action:" prompt, just as with the primary Actions.
 +45      ;;
 +46      ;;NOTE! There are two ways to print a patient's Immunization History:
 +47      ;;
 +48      ;;      1) At the Select Action prompt enter "PL" or "Print List".
 +49      ;;         This action will print or queue the entire Patient View Screen
 +50      ;;         as it appears on your screen.
 +51      ;;
 +52      ;;  or  2) Enter "L" or "Letter Print" and select the "Official
 +53      ;;         Immunization Record" for the form letter to print.
 +54      ;;
 +55       DO LOADTX("TEXT1",,.BITEXT)
 +56       QUIT 
 +57      ;
 +58      ;
 +59      ;----------
LOADTX(BILINL,BITAB,BITEXT) ;EP
 +1        IF $GET(BILINL)=""
               QUIT 
 +2        NEW I,T,X
           SET T=""
           IF '$DATA(BITAB)
               SET BITAB=5
           FOR I=1:1:BITAB
               SET T=T_" "
 +3        FOR I=1:1
               SET X=$TEXT(@BILINL+I)
               IF X'[";;"
                   QUIT 
               SET BITEXT(I)=T_$PIECE(X,";;",2)
 +4        QUIT