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

BIPATCO1.m

Go to the documentation of this file.
  1. BIPATCO1 ;IHS/CMI/MWR - BUILD LIST ARRAY OF CONTRAS; MAY 10, 2010
  1. ;;8.5;IMMUNIZATION;;SEP 01,2011
  1. ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
  1. ;; BUILD LISTMANAGER ARRAY FOR DISPLAY AND EDIT OF
  1. ;; PATIENT'S CONTRAINDICATIONS.
  1. ;
  1. ;
  1. ;----------
  1. INIT ;EP
  1. ;---> Initialize variables and list array.
  1. ;
  1. S VALMSG="Enter ?? for more actions."
  1. ;
  1. ;---> If BIDFN not supplied, set Error Code and quit.
  1. I '$G(BIDFN) D ERRCD^BIUTL2(201,,1) Q
  1. ;
  1. ;---> Initialize RPC variables.
  1. ; BI31 - Delimiter between return value and return error.
  1. ; BIRETVAL - Return value of valid data from RPC.
  1. ; BIRETERR - Return value (text string) of error from RPC.
  1. ;
  1. N BI31,BIRETVAL,BIRETERR
  1. S BI31=$C(31)_$C(31),BIRETVAL=""
  1. ;
  1. ;---> RPC to gather Contraindications History.
  1. D CONTRAS^BIRPC5(.BIRETVAL,BIDFN)
  1. ;
  1. ;---> If BIRETERR has a value, display it and quit.
  1. S BIRETERR=$P(BIRETVAL,BI31,2)
  1. I BIRETERR]"" D EN^DDIOL("* "_BIRETERR,"","!!?5"),DIRZ^BIUTL3() Q
  1. ;
  1. ;---> Set BICONT=to a string of Contraindications for this patient.
  1. ;---> * NOTE! BICONT(BIDFN) is not newed; it is used to edit and delete
  1. ; Immunizations for this patient (sub BIDFN for insurance).
  1. ;
  1. K BICONT(BIDFN)
  1. S BICONT(BIDFN)=$P(BIRETVAL,BI31,1)
  1. ;
  1. ;---> Build Listmanager array from BICONT(BIDFN) string.
  1. K ^TMP("BILMCO",$J)
  1. N BIENT,BILINE,I,V,X,Y,Z
  1. S BIENT=0,BILINE=0,V="|",Z=""
  1. ;
  1. ;---> Insert blank line at the top of the List Region.
  1. S ^TMP("BILMCO",$J,1,0)=""
  1. S ^TMP("BILMCO",$J,"IDX",1,1)=""
  1. ;
  1. ;---> Build Listmanager array from BICONT string.
  1. ;
  1. F I=1:1 S Y=$P(BICONT(BIDFN),U,I) Q:Y="" D
  1. .;---> Build display line for this Contraindication.
  1. .S X=" "_I_" "
  1. .S X=X_$P(Y,V,2)_":",X=$$PAD^BIUTL5(X,19)_$P(Y,V,3)
  1. .S X=$$PAD^BIUTL5(X,47)_$P(Y,V,4)
  1. .;
  1. .;---> Set formatted Contraindication line and index in ^TMP.
  1. .S ^TMP("BILMCO",$J,I+1,0)=X
  1. .S ^TMP("BILMCO",$J,"IDX",I+1,I)=""
  1. ;
  1. ;---> Finish up Listmanager List Count.
  1. S VALMCNT=I
  1. I VALMCNT>12 D
  1. .S VALMSG="Scroll down to view more. Type ?? for more actions."
  1. Q