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

BILOT1.m

Go to the documentation of this file.
  1. BILOT1 ;IHS/CMI/MWR - EDIT LOT NUMBERS.; MAY 10, 2010
  1. ;;8.5;IMMUNIZATION;**2**;MAY 15,2012
  1. ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
  1. ;; EDIT LOT NUMBER FIELDS.
  1. ; PATCH 2: Display number of Lots in list. INIT+50
  1. ;
  1. ;
  1. ;----------
  1. INIT ;EP
  1. ;---> Initialize variables and list array.
  1. ;
  1. S VALMSG="Enter ?? for more actions."
  1. S VALM("TITLE")=$$LMVER^BILOGO
  1. ;
  1. ;---> Build Listmanager array.
  1. K ^TMP("BILOT",$J),BILOT,BITMP
  1. N BIENT,BILINE,BITMP S BIENT=0,BILINE=0
  1. ;---> BICOLL=Order of Listing (see linelabel CHGORDR below.
  1. S:'$G(BICOLL) BICOLL=1
  1. ;---> Exclude inactive lots unless BIINACT=1. vvv83
  1. S:'$G(BIINACT) BIINACT=0
  1. ;
  1. N BIIEN S BIIEN=0
  1. F S BIIEN=$O(^AUTTIML(BIIEN)) Q:'BIIEN D
  1. .I '$D(^AUTTIML(BIIEN,0)) K ^AUTTIML(BIIEN) Q
  1. .N BIACT,BIEXP,BILOT,BIVNAM,BIUNSD,Y,X,Z
  1. .S Y=^AUTTIML(BIIEN,0),BILOT=$P(Y,U),BIACT=+$P(Y,U,3)
  1. .S BIUNSD=$P(Y,U,12) S:BIUNSD="" BIUNSD="NA"
  1. .;---> Quit if excluding Inactive Lots.
  1. .Q:('BIINACT&BIACT=1)
  1. .S:BILOT="" BILOT="UNKNOWN"
  1. .;---> If no Exp Date, set Exp Date=last in list.
  1. .S BIEXP=+$P(Y,U,9) S:'BIEXP BIEXP=9999999
  1. .S BIVNAM=+$P(Y,U,4),BIVNAM=$$VNAME^BIUTL2(BIVNAM)
  1. .D
  1. ..I BICOLL=2 S W=BIEXP,X=BIVNAM,Y=BIUNSD,Z=BILOT Q ;vvv83
  1. ..I BICOLL=3 S W=BILOT,X=BIVNAM,Y=BIEXP,Z=BIUNSD Q
  1. ..I BICOLL=4 S W=BIVNAM,X=BIUNSD,Y=BIEXP,Z=BILOT Q
  1. ..I BICOLL=5 S W=BIVNAM,X=BIEXP,Y=BIUNSD,Z=BILOT Q
  1. ..I BICOLL=6 S W=BIVNAM,X=BILOT,Y=BIEXP,Z=BILOT Q
  1. .. S W=BIUNSD,X=BIVNAM,Y=BIEXP,Z=BILOT Q
  1. .S BITMP(BIACT,W,X,Y,Z,BIIEN)=BIIEN
  1. ;
  1. N N S N="" F S N=$O(BITMP(N)) Q:(N="") D
  1. .;---> Place a linefeed between Active and Inactive.
  1. .I N D WRITE(.BILINE,,,BIENT)
  1. .;
  1. .N M S M="" F S M=$O(BITMP(N,M)) Q:(M="") D
  1. ..N L S L="" F S L=$O(BITMP(N,M,L)) Q:(L="") D
  1. ...N K S K="" F S K=$O(BITMP(N,M,L,K)) Q:(K="") D
  1. ....N J S J="" F S J=$O(BITMP(N,M,L,K,J)) Q:(J="") D
  1. .....N P S P="" F S P=$O(BITMP(N,M,L,K,J,P)) Q:(P="") D
  1. ......D LINE(BITMP(N,M,L,K,J,P),.BILINE,.BIENT)
  1. ;
  1. ;---> Finish up Listmanager List Count.
  1. S VALMCNT=BILINE
  1. I VALMCNT>12 D
  1. .;
  1. .;********** PATCH 2, v8.5, MAY 15,2012, IHS/CMI/MWR
  1. .;---> Display number of Lots in list.
  1. .;S VALMSG="Scroll down to view more. Type ?? for more actions"
  1. .N Y S Y=VALMCNT S:$G(BIINACT) Y=Y-1
  1. .S VALMSG=Y_" Lots: Scroll down to view more, or type ??."
  1. .;**********
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. LINE(BIIEN,BILINE,BIENT) ;EP
  1. ;---> Gather data for each Lot and write to ^TMP.
  1. ;---> Parameters:
  1. ; 1 - BIIEN (req) IEN of Lot.
  1. ; 2 - BILINE (ret) Last line# written.
  1. ; 3 - BIENT (opt) Entry Number for LM selection in VALMY
  1. ;
  1. N BI0,X,Y
  1. S BI0=^AUTTIML(BIIEN,0)
  1. ;
  1. ;---> Set Item# and build Item# array=IEN of Vaccine.
  1. S BIENT=BIENT+1,BILOT(BIENT)=BIIEN
  1. ;
  1. ;---> Item#.
  1. S X=" "_$S(BIENT<10:" "_BIENT,1:BIENT)
  1. ;
  1. ;---> Lot Number.
  1. S X=X_" "_$P(BI0,U)
  1. S X=$$PAD^BIUTL5(X,27,".")
  1. ;
  1. ;---> Vaccine.
  1. S X=X_$$VNAME^BIUTL2($P(BI0,U,4))
  1. S X=$$PAD^BIUTL5(X,39,".")
  1. ;
  1. ;---> Active/Inactive.
  1. S X=X_$S($P(BI0,U,3)=1:"Inactive",1:"Active")
  1. S X=$$PAD^BIUTL5(X,47,".")
  1. ;
  1. ;---> Expiration Date.
  1. I $P(BI0,U,9) S X=X_$$LOTEXP^BIRPC3(BIIEN,1)
  1. S X=$$PAD^BIUTL5(X,57,".")
  1. ;
  1. ;---> Starting Count.
  1. I $P(BI0,U,11) S X=X_$J($P(BI0,U,11),5)
  1. S X=$$PAD^BIUTL5(X,64,".")
  1. ;
  1. ;---> Doses Unused (amount left).
  1. I $P(BI0,U,11) S X=X_$J($$LOTRBAL^BIRPC3(BIIEN),5)
  1. S X=$$PAD^BIUTL5(X,71,".")
  1. ;
  1. ;---> Facility (if entered).
  1. I $P(BI0,U,14) S X=X_$E($$INSTTX^BIUTL6($P(BI0,U,14)),1,8)
  1. S X=$$PAD^BIUTL5(X,80,".")
  1. ;
  1. ;---> Set this Vaccine display row and index in ^TMP.
  1. D WRITE(.BILINE,X,,BIENT)
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. WRITE(BILINE,BIVAL,BIBLNK,BIENT) ;EP
  1. ;---> Write lines to ^TMP (see documentation in ^BIW).
  1. ;---> Parameters:
  1. ; 1 - BILINE (ret) Last line# written.
  1. ; 2 - BIVAL (opt) Value/text of line (Null=blank line).
  1. ; 3 - BIBLNK (opt) Number of blank lines to add after line sent.
  1. ; 4 - BIENT (opt) Entry Number for LM selection in VALMY
  1. ;
  1. Q:'$D(BILINE)
  1. D WL^BIW(.BILINE,"BILOT",$G(BIVAL),$G(BIBLNK),$G(BIENT))
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. EDITLOT(BINEW) ;EP
  1. ;---> Edit a Lot Number.
  1. ;---> Parameters:
  1. ; 2 - BINEW (opt) 1=new lot number being added; 0/""=edit.
  1. ;
  1. ;---> Steps:
  1. ; 1) This entry point is called by the Protocol:
  1. ; BI LOT NUMBER SELECT, an action on the
  1. ; List Manager menu protocol: BI MENU LOT NUMBER EDIT.
  1. ;
  1. ; 2) This code calls ScreenMan form:
  1. ; BI FORM-LOT NUMBER EDIT to build BI local array
  1. ; of data for add/edit of a Lot Number.
  1. ; Data already stored in the BI local array is loaded
  1. ; into the form by LOADLOT^BILOT1, which is called
  1. ; by the Pre-Action of Block for Vaccine Edit.
  1. ;
  1. ; 3) Use BI local array to send data to FDIE^BIFMAN.
  1. ;
  1. ;---> If BINEW, add a new Lot Number and quit.
  1. I $G(BINEW) D EDITSCR(,1) D RESET Q
  1. ;
  1. ;---> Call the Listmanager Generic Selector of items displayed.
  1. N VALMY
  1. D EN^VALM2(XQORNOD(0),"OS")
  1. ;
  1. ;---> Check that a Listman Item was passed.
  1. I '$D(VALMY) D ERRCD^BIUTL2(406,,1) D RESET Q
  1. ;---> Now set Y=Item# selected from the list.
  1. N Y S Y=$O(VALMY(0))
  1. I '$G(Y) D ERRCD^BIUTL2(406,,1) D RESET Q
  1. I $G(BILOT(Y))="" D ERRCD^BIUTL2(511,,1) D RESET Q
  1. D EDITSCR(+BILOT(Y))
  1. D FULL^VALM1
  1. D RESET
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. EDITSCR(BILOT,BINEW) ;EP
  1. ;---> Add or edit the fields of a Lot Number.
  1. ;---> (Make this an RPC in the future?)
  1. ;---> Parameters:
  1. ; 1 - BILOT (opt) Lot Number IEN.
  1. ; 2 - BINEW (opt) 1=new lot number being added; 0=edit.
  1. ;
  1. ;---> If this is an edit, check that IEN of Lot Number.
  1. I '$G(BINEW),$G(^AUTTIML(+$G(BILOT),0))="" D ERRCD^BIUTL2(511,,1) Q
  1. ;
  1. ;---> If this is an edit, preload existing values for Screenman form.
  1. N BI D:$G(BILOT)
  1. .N Y S Y=^AUTTIML(BILOT,0)
  1. .S BI("AS")=$P(Y,U,1) ;Full Lot Number Text.
  1. .S BI("A")=$P(BI("AS"),"*") ;Lot Number Text.
  1. .S BI("S")=$P(BI("AS"),"*",2) ;Lot Number Text.
  1. .S BI("B")=$P(Y,U,4) ;Vaccine.
  1. .S BI("C")=+$P(Y,U,3) ;Status Active/Inactive.
  1. .S BI("D")=$P(Y,U,9) ;Expiration Date.
  1. .S BI("E")=$P(Y,U,11) ;Starting Count.
  1. .S BI("F")=$P(Y,U,12) ;Doses Unused.
  1. .S BI("G")=$P(Y,U,15) ;Low Supply Alert.
  1. .S BI("H")=$P(Y,U,13) ;Source VFC or NON-VFC.
  1. .S BI("M")=$P(Y,U,2) ;Manufacturer.
  1. .S BI("N")=$P(Y,U,14) ;Facility.
  1. .S BI("O")=$P(Y,U,17) ;NDC Code.
  1. ;
  1. ;---> Call Screenman to build BI local array of data by user.
  1. N BISAVE
  1. N DR S DR="[BI FORM-LOT NUMBER EDIT]"
  1. D DDS^BIFMAN(9999999.41,DR,$G(BILOT),"S",.BISAVE,.BIPOP)
  1. ;
  1. ;---> Quit if user did not save this data.
  1. Q:('$G(BISAVE))
  1. ;
  1. ;---> Build local array for this Lot Number.
  1. N BIERR,BIFLD
  1. S BI("AS")=BI("A")
  1. I $G(BI("S"))]"" S BI("AS")=BI("AS")_"*"_BI("S")
  1. ;
  1. ;---> v8.5: If Active Status="", set it to 0, so PCC will be happy.
  1. I $G(BI("C"))="" S BI("C")=0
  1. ;
  1. S BIFLD(.01)=$G(BI("AS")),BIFLD(.03)=$G(BI("C")),BIFLD(.09)=$G(BI("D"))
  1. S BIFLD(.11)=$G(BI("E")),BIFLD(.12)=$G(BI("F")),BIFLD(.15)=$G(BI("G"))
  1. S BIFLD(.13)=$G(BI("H")),BIFLD(.02)=$G(BI("M")),BIFLD(.14)=$G(BI("N"))
  1. S BIFLD(.16)=$G(BI("A")),BIFLD(.17)=$G(BI("O"))
  1. ;---> If this is a new Lot Number, include the Vaccine.
  1. S:$G(BINEW) BIFLD(.04)=$G(BI("B"))
  1. ;
  1. ;
  1. ;---> If this is a new Lot Number and it already exists (not a sub-lot),
  1. ;---> then display error and quit.
  1. I $G(BINEW),$D(^AUTTIML("B",BI("AS"))) D Q
  1. .D CLEAR^VALM1,FULL^VALM1,TITLE^BIUTL5("EDIT LOT NUMBER FIELDS")
  1. .W !!?23,"This Lot Number already exists!"
  1. .W !!?18,"Please exit and select it from the list."
  1. .W !!!!?5,"NOTE: It It may be Inactive. Try displaying Inactive Lot Numbers"
  1. .W !?11,"as well as Active ones.",!
  1. .D DIRZ^BIUTL3()
  1. ;
  1. ;
  1. ;---> Add/update the Lot Number.
  1. D
  1. .I $G(BINEW) D UPDATE^BIFMAN(9999999.41,.BILOT,.BIFLD,.BIERR) Q
  1. .D FDIE^BIFMAN(9999999.41,BILOT,.BIFLD,.BIERR)
  1. ;
  1. ;---> If there was an error, display it.
  1. I $G(BIERR)]"" D Q
  1. .D CLEAR^VALM1,FULL^VALM1,TITLE^BIUTL5("EDIT LOT NUMBER FIELDS")
  1. .W !!?3,BIERR D DIRZ^BIUTL3()
  1. ;
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. LOADLOT ;EP
  1. ;---> Code to load Lot Number data for ScreenMan Edit form.
  1. ;---> Called by Pre Action of Block BI BLK-LOT NUMBER EDIT on
  1. ;---> Form BI FORM-LOT NUMBER EDIT.
  1. ;
  1. ;---> If this is a NEW Lot Number, enable editing of Vaccine, Field 2.
  1. I $G(BINEW) D UNED^DDSUTL(2,,,0)
  1. ;
  1. ;---> Load Lot Number.
  1. I $G(BI("A"))]"" D PUT^DDSVALF(1,,,BI("A"),"I")
  1. ;
  1. ;---> Load Sub-lot, if it exists.
  1. I $G(BI("S"))]"" D PUT^DDSVALF(1.5,,,BI("S"),"I")
  1. ;
  1. ;---> Load Vaccine Name (.01).
  1. I $G(BI("B"))]"" D PUT^DDSVALF(2,,,BI("B"),"I")
  1. ;
  1. ;---> Load Vaccine Short Name (.02).
  1. I $G(BI("B"))]"" D PUT^DDSVALF(2.5,,,"("_$$VNAME^BIUTL2(BI("B"))_")")
  1. ;
  1. ;---> Load Lot Number Status Active/Inactive.
  1. I $G(BI("C"))]"" D PUT^DDSVALF(3,,,BI("C"),"I")
  1. ;
  1. ;---> Load Lot Number Expiration Date.
  1. I $G(BI("D"))]"" D PUT^DDSVALF(4,,,BI("D"),"I")
  1. ;
  1. ;---> Load the Starting Count.
  1. I $G(BI("E"))]"" D PUT^DDSVALF(5,,,BI("E"),"I")
  1. ;
  1. ;---> Load the Doses Unused.
  1. I $G(BI("F"))]"" D PUT^DDSVALF(6,,,BI("F"),"I")
  1. ;
  1. ;---> Load the Low Supply Alert.
  1. I $G(BI("G"))]"" D PUT^DDSVALF(7,,,BI("G"),"I")
  1. ;
  1. ;---> Load the Source (VFC or NON-VFC).
  1. I $G(BI("H"))]"" D PUT^DDSVALF(11,,,BI("H"),"I")
  1. ;
  1. ;---> Load Manufacturer.
  1. I $G(BI("M"))]"" D PUT^DDSVALF(10,,,BI("M"),"I")
  1. ;
  1. ;---> Load Facility.
  1. I $G(BI("N"))]"" D PUT^DDSVALF(9,,,BI("N"),"I")
  1. ;
  1. ;---> Load NDC Code.
  1. I $G(BI("O"))]"" D PUT^DDSVALF(4.5,,,BI("O"),"I")
  1. ;
  1. ;---> Calculate the number of doses that have been used.
  1. D CALCDOS($G(BI("E")),$G(BI("F")))
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. INVOFF(BIZ) ;EP
  1. ;---> Trigger Popup that Doses Unused cannot be greater than
  1. ;---> the Starting Count.
  1. ;---> Called from Fields 5 & 6 on Form BI FORM-LOT NUMBER EDIT.
  1. ;---> Parameters:
  1. ; 1 - BIZ (req) Field triggered from: 1=Starting Count
  1. ; 2=Doses Unused
  1. ;
  1. Q:'$G(BIZ)
  1. S DDSSTACK="BI PAGE-INVENTORY OFF"
  1. I BIZ=1 D PUT^DDSVALF(5,,,$G(DDSOLD),"I") Q
  1. I BIZ=2 D PUT^DDSVALF(6,,,$G(DDSOLD),"I") Q
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. CALCDOS(E,F) ;EP
  1. ;---> Calculate the number of doses of a Lot Number that have been used.
  1. ;---> Called from Fields 5 & 6 on Form BI FORM-LOT NUMBER EDIT.
  1. ;---> Parameters:
  1. ; 1 - E (req) Starting Count
  1. ; 2 - F (req) Doses Unused
  1. ;
  1. Q:($G(E)="") Q:($G(F)="")
  1. D PUT^DDSVALF(8,,,(E-F),"I")
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. VACINA1 ;EP
  1. ;---> Trigger Popup that says vaccine must be Active.
  1. ;---> Called from Fields 2 on Form BI FORM-LOT NUMBER EDIT.
  1. ;
  1. ;---> If this vaccine is Inactive, display popup.
  1. ;---> Ex
  1. I $P($G(^AUTTIMM(+X,0)),U,7) D Q
  1. .S DDSSTACK="BI PAGE-INACTIVE VACCINE"
  1. ;
  1. S BINEW(1)=1 S DDSBR=10
  1. I $G(X) S BI("B")=X D PUT^DDSVALF(2.5,,,"("_$$VNAME^BIUTL2(X)_")")
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. VACINA2 ;EP
  1. ;---> Called from Fields 3 on Form BI FORM-LOT NUMBER EDIT.
  1. ;---> If no vaccine was selected, send user back to Field 2 (vaccine).
  1. I '$G(BI("B")) S DDSBR=2 D Q
  1. .;D HLP^DDSUTL("Select the Vaccine that corresponds to this Lot Number.")
  1. ;
  1. N BIT S BIT="Select whether this Lot Number should be Active or Inactive."
  1. S BIT=BIT_" Note that users will not be able to select an Inactive Lot "
  1. S BIT=BIT_"Number if the Category is Ambulatory."
  1. D HLP^DDSUTL(BIT)
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. VACINA3 ;EP
  1. ;---> After code from popup, going back to Form BI FORM-LOT NUMBER EDIT.
  1. ;---> To get there: Get to the form (above), press F1-P, then page 5,
  1. ;---> then F1-V, tab to BI BLK-..., spacebar, F4, Post Action at the bottom.
  1. ;
  1. ;---> Kill the vaccine node, null out the display of vaccine names.
  1. K BI("B") D PUT^DDSVALF(2,2,1,,"E"),PUT^DDSVALF(2.5,2,1,,"E")
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. RESET ;EP
  1. ;---> Update partition for return to Listmanager.
  1. I $D(VALMQUIT) S VALMBCK="Q" Q
  1. D TERM^VALM0 S VALMBCK="R"
  1. D INIT^BILOT,HDR^BILOT()
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. CHGORDR ;EP
  1. ;
  1. D CHGORDR^BILOT2
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. TEXT2 ;EP
  1. ;;
  1. ;;The Lot Number Table will always be listed with the group of
  1. ;;all ACTIVE Lot Numbers first, followed by all INACTIVE Lot Numbers.
  1. ;;However, within those two groups you may select the order in which
  1. ;;the Lot Numbers are displayed, as follows:
  1. ;;
  1. ;; 1) By Unused Doses (least first)
  1. ;; 2) By Expiration Date
  1. ;; 3) By Lot Number
  1. ;; 4) By Vaccine Name, then by Unused Doses
  1. ;; 5) By Vaccine Name, then by Exp Date
  1. ;; 6) By Vaccine Name, then by Lot Number
  1. ;;
  1. D PRINTX("TEXT2")
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. INACTA ;EP
  1. ;---> Automatically Inactivate old Lot Numbers that either have expired
  1. ;---> or have no Expiration Date.
  1. ;
  1. D FULL^VALM1,TITLE^BIUTL5("INACTIVATE OLD LOT NUMBERS"),TEXT3^BILOT
  1. N DIR,Y D INACTA1
  1. D ^DIR
  1. S:$D(DIRUT) BIPOP=1
  1. I Y'=1 D Q
  1. .W !!?5,"Okay. NO changes made!" D DIRZ^BIUTL3()
  1. .D RESET
  1. ;
  1. D TITLE^BIUTL5("INACTIVATE OLD LOT NUMBERS"),TEXT33^BILOT,INACTA1
  1. D ^DIR
  1. S:$D(DIRUT) BIPOP=1
  1. I Y'=1 D Q
  1. .W !!?5,"Okay. NO changes made!" D DIRZ^BIUTL3()
  1. .D RESET
  1. ;
  1. D INACTLN
  1. D RESET
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. INACTA1 ;EP
  1. ;---> Set DIR values for linelabel INACTA.
  1. S DIR(0)="YA"
  1. S DIR("A")=" Please answer either YES or NO: ",DIR("B")="NO"
  1. S DIR("?",1)=" Enter YES to automatically Inactivate Lot Numbers, "
  1. S DIR("?")=" enter NO to make no changes."
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. INACTLN ;EP
  1. ;---> Inactivate all Lot Numbers that either have expired or have
  1. ;---> no Expiration Date.
  1. ;
  1. D ^XBKVAR
  1. N M,N S M=0,N=0
  1. F S N=$O(^AUTTIML(N)) Q:'N D
  1. .Q:'$D(^AUTTIML(N,0))
  1. .;---> Do not Inactivate if Exp Date is later than Today.
  1. .Q:($P(^AUTTIML(N,0),"^",9)>$G(DT))
  1. .;---> Quit if this Lot Number is already Inactive.
  1. .Q:($P(^AUTTIML(N,0),"^",3)=1)
  1. .;---> Inactivate this Lot Number.
  1. .S $P(^AUTTIML(N,0),"^",3)=1,M=M+1
  1. W !!?5,"Done. ",M," Lot Numbers have been Inactivated." D DIRZ^BIUTL3()
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. PRINTX(BILINL,BITAB) ;EP
  1. Q:$G(BILINL)=""
  1. N I,T,X S T="" S:'$D(BITAB) BITAB=5 F I=1:1:BITAB S T=T_" "
  1. F I=1:1 S X=$T(@BILINL+I) Q:X'[";;" W !,T,$P(X,";;",2)
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. NULLACT ;EP
  1. ;---> Activate all Lot Numbers that have a Status=null.
  1. ;---> Call by postinit for Imm v8.5.
  1. ;
  1. D ^XBKVAR
  1. W !!?5,"Checking Lot Numbers for null Status..."
  1. N M,N S M=0,N=0
  1. F S N=$O(^AUTTIML(N)) Q:'N D
  1. .Q:'$D(^AUTTIML(N,0))
  1. .;---> Quit if this lot number has a Status .
  1. .Q:($P(^AUTTIML(N,0),"^",3)'="")
  1. .;---> Okay, Status must be null, so set it to Active.
  1. .S $P(^AUTTIML(N,0),"^",3)=0,M=M+1
  1. W !!?5,"Done. ",M," Lot Numbers have been fixed." D DIRZ^BIUTL3()
  1. Q