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

BIDUR1.m

Go to the documentation of this file.
  1. BIDUR1 ;IHS/CMI/MWR - RETRIEVE/STORE PATIENTS.; MAY 10, 2010
  1. ;;8.5;IMMUNIZATION;;SEP 01,2011
  1. ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
  1. ;; RETRIEVE/STORE PATIENTS FOR DUE LISTS & LETTERS.
  1. ;
  1. ;
  1. ;----------
  1. STORE(BIDFN,BIFDT,BIORD,BIERR,BIVAL,BISITE) ;EP
  1. ;---> Store this patient in the Order specified.
  1. ;---> Parameters:
  1. ; 1 - BIDFN (req) Patient's IEN (DFN).
  1. ; 2 - BIFDT (req) Forecast date.
  1. ; 3 - BIORD (req) Order of listing (default=1, by age).
  1. ; 4 - BIERR (ret) Error Code.
  1. ; 5 - BIVAL (opt) Value to set ^TMP(Patient...) node equal to.
  1. ; 6 - BISITE (req) Site IEN.
  1. ;
  1. ;---> Check for required Variables.
  1. I '$G(BIDFN) S BIERR=201 Q
  1. I '$G(BIFDT) S BIERR=616 Q
  1. S:'$G(BIORD) BIORD=1
  1. S:'$G(BISITE) BISITE=$G(DUZ(2)) I '$G(BISITE) S BIERR=109 Q
  1. ;
  1. ;---> Store this patient in the Order specified:
  1. ;
  1. ;---> By Patient Alphabetically.
  1. I BIORD=2 D Q
  1. .N X,Y,Z
  1. .S X=1,Y=1,Z=$$NAME^BIUTL1(BIDFN)
  1. .S ^TMP("BIDUL",$J,X,Y,Z,BIDFN)=$G(BIVAL)
  1. ;
  1. ;---> By HRCN/Chart#.
  1. I BIORD=3 D Q
  1. .N X,Y,Z
  1. .S X=1,Y=1,Z=$$HRCN^BIUTL1(BIDFN,BISITE,1)
  1. .S ^TMP("BIDUL",$J,X,Y,Z,BIDFN)=$G(BIVAL)
  1. ;
  1. ;---> By Case Manager.
  1. I BIORD=4 D Q
  1. .N X,Y,Z
  1. .S X=$$CMGR^BIUTL1(BIDFN,1),Y=1,Z=$$NAME^BIUTL1(BIDFN)
  1. .S ^TMP("BIDUL",$J,X,Y,Z,BIDFN)=$G(BIVAL)
  1. ;
  1. ;---> By Case Manager, then Current Community.
  1. I BIORD=5 D Q
  1. .N X,Y,Z
  1. .S X=$$CMGR^BIUTL1(BIDFN,1),Y=$$CURCOM^BIUTL11(BIDFN,1)
  1. .S Z=$$NAME^BIUTL1(BIDFN)
  1. .S ^TMP("BIDUL",$J,X,Y,Z,BIDFN)=$G(BIVAL)
  1. ;
  1. ;---> By Current Community, then Case Manager.
  1. I BIORD=6 D Q
  1. .N X,Y,Z
  1. .S X=$$CURCOM^BIUTL11(BIDFN,1),Y=$$CMGR^BIUTL1(BIDFN,1)
  1. .S Z=$$NAME^BIUTL1(BIDFN)
  1. .S ^TMP("BIDUL",$J,X,Y,Z,BIDFN)=$G(BIVAL)
  1. ;
  1. ;---> By Current Community, then Patient Age.
  1. I BIORD=7 D Q
  1. .N X,Y,Z
  1. .S X=$$CURCOM^BIUTL11(BIDFN,1),Y=9999999-$$DOB^BIUTL1(BIDFN)
  1. .S Z=$$NAME^BIUTL1(BIDFN)
  1. .S ^TMP("BIDUL",$J,X,Y,Z,BIDFN)=$G(BIVAL)
  1. ;
  1. ;---> By Current Community, then Patient Name.
  1. I BIORD=8 D Q
  1. .N X,Y,Z
  1. .S X=$$CURCOM^BIUTL11(BIDFN,1),Y=1,Z=$$NAME^BIUTL1(BIDFN)
  1. .S ^TMP("BIDUL",$J,X,Y,Z,BIDFN)=$G(BIVAL)
  1. ;
  1. ;---> By Current Community, then Patient Chart#.
  1. I BIORD=9 D Q
  1. .N X,Y,Z
  1. .S X=$$CURCOM^BIUTL11(BIDFN,1),Y=1,Z=$$HRCN^BIUTL1(BIDFN,BISITE,1)
  1. .S ^TMP("BIDUL",$J,X,Y,Z,BIDFN)=$G(BIVAL)
  1. ;
  1. ;---> By Zipcode, then Patient Name.
  1. I BIORD=10 D Q
  1. .N X,Y,Z
  1. .S X=$$ZIP^BIUTL1(BIDFN),Y=1,Z=$$NAME^BIUTL1(BIDFN)
  1. .S ^TMP("BIDUL",$J,X,Y,Z,BIDFN)=$G(BIVAL)
  1. ;
  1. ;---> By Designated Provider.
  1. I BIORD=11 D Q
  1. .N X,Y,Z
  1. .S X=$$DPRV^BIUTL1(BIDFN,1),Y=1,Z=$$NAME^BIUTL1(BIDFN)
  1. .S ^TMP("BIDUL",$J,X,Y,Z,BIDFN)=$G(BIVAL)
  1. ;
  1. ;---> By Patient Age (Default, BIORD=1).
  1. N X,Y,Z
  1. S X=1,Y=9999999-$$DOB^BIUTL1(BIDFN),Z=$$NAME^BIUTL1(BIDFN)
  1. S ^TMP("BIDUL",$J,X,Y,Z,BIDFN)=$G(BIVAL)
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. BENT(BIDFN,BIBEN) ;EP
  1. ;---> Beneficiary Type indicator.
  1. ;---> Return 1 if not selecting all Beneficiary Types and if this
  1. ;---> patient's Beneficiary Type is not one of the ones selected.
  1. ;
  1. Q:'$G(BIDFN) 1
  1. Q:$D(BIBEN("ALL")) 0
  1. N BIBENT S BIBENT=$$BENTYP^BIUTL11(BIDFN)
  1. Q:'BIBENT 1
  1. Q:'$D(BIBEN(BIBENT)) 1
  1. Q 0