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

BILOT.m

Go to the documentation of this file.
  1. BILOT ;IHS/CMI/MWR - EDIT LOT NUMBERS.; MAY 10, 2010
  1. ;;8.5;IMMUNIZATION;**9**;OCT 01,2014
  1. ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
  1. ;; EDIT LOT NUMBER FIELDS.
  1. ; PATCH 2: Redisplay Message area (with # of Lots) in List Template. HELP1+5
  1. ; PATCH 9: Removed until perhaps Patch 10. Update help text. HELP+5
  1. ;
  1. ;
  1. ;
  1. ;----------
  1. START ;EP
  1. ;---> Lookup Lot Numbers and edit their fields. vvv83
  1. D SETVARS^BIUTL5 K ^TMP("BILOT",$J) N BICOLL,BISUBT,BITMP,BIINACT
  1. S BISUBT="1:Unused Doses;2:Expiration Date;3:Lot Number"
  1. S BISUBT=BISUBT_";4:Vaccine Name, then by Unused Doses"
  1. S BISUBT=BISUBT_";5:Vaccine Name, then by Exp Date"
  1. S BISUBT=BISUBT_";6:Vaccine Name, then by Lot Number"
  1. ;
  1. ;---> If Vaccine Table is not standard, display Error Text and quit.
  1. I $D(^BISITE(-1)) D ERRCD^BIUTL2(503,,1) Q
  1. ;
  1. D EN
  1. D EXIT
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. EN ;EP
  1. D EN^VALM("BI LOT TABLE EDIT")
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. PRINT ;EP
  1. ;---> Print Lot Number Table.
  1. ;---> Called by Protocol BI LOT NUMBER TABLE PRINT, which is the
  1. ;---> Print List Protocol for the List: BI LOT NUMBER TABLE EDIT.
  1. ;
  1. D DEVICE(.BIPOP)
  1. I $G(BIPOP) D RESET Q
  1. ;
  1. D HDR(1),INIT^BILOT1
  1. D PRTLST^BIUTL8("BILOT")
  1. D RESET
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. HDR(BIPRT) ;EP
  1. ;---> Header code for both Listman Screen and Print List.
  1. ;---> Parameters:
  1. ; 1 - BIPRT (opt) If BIPRT=1 array is for print: Change column
  1. ; header line and add Site Header line.
  1. ;
  1. N BILINE,X,Y S BILINE=0 K VALMHDR
  1. N BICRT S BICRT=$S(($E($G(IOST))="C")!(IOST["BROWSER"):1,1:0)
  1. ;
  1. D WH^BIW(.BILINE)
  1. S X=$$REPHDR^BIUTL6(DUZ(2)),BIDASH=$L(X)+2 D CENTERT^BIUTL5(.X)
  1. D WH^BIW(.BILINE,X)
  1. S X=$$SP^BIUTL5(BIDASH,"-") D CENTERT^BIUTL5(.X)
  1. D WH^BIW(.BILINE,X)
  1. ;
  1. S X="LOT NUMBER TABLE" S:'$G(BIPRT) X="EDIT "_X
  1. D CENTERT^BIUTL5(.X)
  1. S:BICRT X=IOINHI_X_IOINORM
  1. D WH^BIW(.BILINE,X)
  1. ;
  1. ;---> Subtitle: indicate order of listing.
  1. D:($G(BICOLL)&$D(BISUBT))
  1. .N Y S Y=$P($P(BISUBT,BICOLL_":",2),";") S X=" (Listed by "_Y_")"
  1. .D CENTERT^BIUTL5(.X) S:BICRT X=IOINHI_X_IOINORM D WH^BIW(.BILINE,X)
  1. ;
  1. D:$G(BIPRT)
  1. .S X=$$SP^BIUTL5(51)_"Printed: "_$$NOW^BIUTL5()
  1. .D WH^BIW(.BILINE,X,1)
  1. .S X=" # Lot Number Vaccine Status Exp Date Start Unused Facility"
  1. .D WH^BIW(.BILINE,X)
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. INIT ;EP
  1. ;---> Initialize variables and list array.
  1. D INIT^BILOT1
  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,HDR() Q
  1. ;
  1. ;
  1. ;----------
  1. DEVICE(BIPOP) ;EP
  1. ;---> Get Device and possibly queue to Taskman.
  1. ;---> Parameters:
  1. ; 1 - BIPOP (ret) If error or Queue, BIPOP=1
  1. ;
  1. K %ZIS,IOP S BIPOP=0
  1. S ZTRTN="DEQUEUE^BILOT"
  1. D ZSAVES^BIUTL3
  1. D ZIS^BIUTL2(.BIPOP,1)
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. DEQUEUE ;EP
  1. ;---> Print Patient Data screen.
  1. D HDR(1),INIT^BILOT1
  1. D PRTLST^BIUTL8("BILOT"),EXIT
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. HELP ;EP
  1. ;---> Help code.
  1. N BIX S BIX=X
  1. D FULL^VALM1
  1. W !!?5,"Enter ""A"" to add or edit a Lot Number, enter ""S"" to Select a Lot"
  1. W !?5,"Number from the left column, enter ""C"" to change the order of the list,"
  1. W !?5,"""S"" to Search for a particular Lot Number, ""D"" to include Inactive Lot"
  1. W !?5,"enter ""I"" to Inactivate expired Lot Numbers, and enter ""H"" to view"
  1. W !?5,"the full help text for the lot number list and its parameters."
  1. D DIRZ^BIUTL3(""," Press ENTER/RETURN to continue")
  1. D:BIX'="??" RE^VALM4
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. HELPNEXT ;EP
  1. ;
  1. ;********** PATCH 10?, v8.5, OCT 01,2014, IHS/CMI/MWR
  1. ;---> Requested removed from Patch 9 by Michelle Ruslavage. Possibly include
  1. ;---> in next patch.
  1. ;---> Update help text below to include new actions from patch.
  1. ;---> Help code.
  1. N BIX S BIX=X
  1. D FULL^VALM1
  1. W !!?5,"Enter ""A"" to add or edit a Lot Number, enter ""E"" to select and Edit a Lot"
  1. W !?5,"Number from the left column, enter ""C"" to change the order of the list,"
  1. W !?5,"""S"" to Search for a particular Lot Number, ""D"" to include Inactive Lot"
  1. W !?5,"Numbers in the display (will appear after all Active Lot Numbers),"
  1. W !?5,"enter ""I"" to Inactivate expired Lot Numbers, and enter ""H"" to view"
  1. W !?5,"the full help text for the lot number list and its parameters."
  1. D DIRZ^BIUTL3(""," Press ENTER/RETURN to continue")
  1. D:BIX'="??" RE^VALM4
  1. Q
  1. ;**********
  1. ;
  1. ;
  1. ;----------
  1. HELP1 ;EP
  1. ;----> Explanation of this report.
  1. N BITEXT D TEXT1(.BITEXT)
  1. D START^BIHELP("EDIT LOT NUMBERS - HELP",.BITEXT)
  1. ;
  1. ;********** PATCH 2, v8.5, MAY 15,2012, IHS/CMI/MWR
  1. ;---> Redisplay Message area (with number of Lots) in List Template.
  1. D RESET^BILOT1
  1. ;**********
  1. Q
  1. ;
  1. ; vvv83
  1. ;----------
  1. TEXT1(BITEXT) ;EP
  1. ;;
  1. ;;This screen allows you to add and edit the eight fields of Lot Numbers.
  1. ;;
  1. ;;NOTE: To show INACTIVE Lot Numbers, select "D Display Inactives."
  1. ;;
  1. ;;To Add a new Lot Number, type "A". If the Lot Number already exists in
  1. ;;the Table, a message will display, directIng you select that Lot Number
  1. ;;for editing.
  1. ;;
  1. ;;To edit an existing Lot Number type "E" and then select the left column
  1. ;;number that corresponds to the Lot Number you wish to edit.
  1. ;;
  1. ;;You may also SEARCH the entire list for any number, name, or combination
  1. ;;of characters by usinng the "S Search List" action.
  1. ;;
  1. ;;You may list the Lots in a variety of manners by using the "C Change List"
  1. ;;action.
  1. ;;
  1. ;;Lastly, you may automatically inactivate ALL Lot Numbers that either
  1. ;;have expired or have no expiration date, by typing "I".
  1. ;;
  1. ;;The fields for each Lot Number are:
  1. ;;
  1. ;;Vaccine - This is the vaccine to which the Lot Number is assigned.
  1. ;; A Vaccine is REQUIRED when entering a New Lot Number.
  1. ;;
  1. ;;Manufacturer (MVX) - This is the standard CDC/HL7 Manufacturer Code
  1. ;; assigned to the company that produced the Lot. Enter ?? in order
  1. ;; to view the entire Manufacturer Code list.
  1. ;; A Manufacturer is REQUIRED when entering a New Lot Number.
  1. ;;
  1. ;;Status - If a Lot Number is set to "Inactive", users will not be
  1. ;; able to select it when entering NEW patient immunizations for this.
  1. ;; vaccine. However, previous immunizations with this Lot Number will
  1. ;; continue to show up on the patient histories.
  1. ;;
  1. ;;Source - Choice are VFC, Other State, or IHS/Tribal,.
  1. ;;
  1. ;;NDC Code - This is the NDC on the box or vial for this lot. Available
  1. ;; NDC's are limited by virtue of the particular vaccine chosen for
  1. ;; this lot number.
  1. ;;
  1. ;;Expiration Date - This is the date that the Lot expires.
  1. ;;
  1. ;;Starting Count - Total number of doses in the starting inventory for
  1. ;; the Lot when it was first received.
  1. ;;
  1. ;;Doses Unused - Number of doses of a lot remaining or unused.
  1. ;; This number will decrease each time an immunization of that Lot Number
  1. ;; is entered into RPMS through the Immunization package or data entry.
  1. ;; The pharmacist or user can also reset this number if it becomes
  1. ;; incorrect, such as might occur with wasted doses, data entry errors,
  1. ;; etc.
  1. ;;
  1. ;; NOTE: This number may become NEGATIVE. A negative number for the
  1. ;; Doses Unused would indicate that deletions, data entry errors, or
  1. ;; testing have caused the number to become negative by mere subtraction
  1. ;; each time it is used in the computer--even if it has not actually
  1. ;; been used clinically. Therefore, it is entirely appropriate for
  1. ;; the vaccine manager or pharmacist to correct the Doses Unused
  1. ;; in order to have it accurately reflect the number of doses that are
  1. ;; still unused in the inventory (in other words, sitting on the shelf).
  1. ;;
  1. ;;Doses Used - This is merely a the Doses Unused subtracted from the
  1. ;; Starting Count.
  1. ;;
  1. ;;Vaccine Source - VFC or non-VFC. Note: If there are two issues of the
  1. ;; same lot, and one issue is VFC and the other is not VFC, it may
  1. ;; be helpful the create a new lot for the VFC issue and give it the
  1. ;; same lot number but append "-vfc" to the end. This way, the two
  1. ;; issues can be tracked, inventoried, and reported on separately
  1. ;; (yet easily identified by the common, original lot number).
  1. ;;
  1. ;;Low Supply Alert - During entry of immunizations, if the number of Unused
  1. ;; Doses falls below the Low Supply Alert for this Lot Number, an alert
  1. ;; will be displayed.
  1. ;;
  1. ;;Health Care Facility - Adding a Health Care Facility to a Lot Number will
  1. ;; will cause that Lot Number to become unavailable for any user who is
  1. ;; NOT logged on to the named Facility.
  1. ;;
  1. ;; In general, there is NO NEED to assign Lot Numbers to specific
  1. ;; Facilities. However, if more than one Facility uses the same
  1. ;; computer (dialing in from remote sites), then it may be desirable
  1. ;; to assign Lot Numbers to specific Facilities. That way, users from
  1. ;; another Facility will be prevented from erroneously using a Lot
  1. ;; Number that is not at their Facility.
  1. ;;
  1. ;; In cases where a Lot Number is truly shared by multiple Facilities
  1. ;; all using the same computer, it may be desirable to create "sub-Lots"
  1. ;; by appending "-a", "-b", "-c", etc. to the Lot Number. For example,
  1. ;; Facility A would get "#1234-a", Facility B would get "#1234-b",
  1. ;; Facility C would get "#1234-c", and so on.
  1. ;;
  1. ;; This would enable the manager or pharmacist to assign a Starting Amount
  1. ;; for each "sub-Lot" to each Facility and ensure that the inventory at
  1. ;; each site individually is accurate.
  1. ;;
  1. ;;
  1. D LOADTX("TEXT1",,.BITEXT)
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. LOADTX(BILINL,BITAB,BITEXT) ;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'[";;" S BITEXT(I)=T_$P(X,";;",2)
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. TEXT3 ;EP
  1. ;;
  1. ;;This option will automatically INACTIVATE ALL Lot Numbers that
  1. ;;have EXPIRED (an Expiration Date prior to today).
  1. ;;
  1. ;;It will also automatically INACTIVATE ALL Lot Numbers that have
  1. ;;NO Expiration Date (as viewed in the Lot Number Table).
  1. ;;
  1. ;; Note: You can REACTIVATE any Lot Number individually at any time
  1. ;; by editing the Lot Number individually from the Edit Lot Numbers
  1. ;; Screen (and resetting the Active Field for that Lot Number).
  1. ;;
  1. ;;Do you wish to INACTIVATE ALL Lot Numbers that either have EXPIRED
  1. ;;or have NO Expiration Date?
  1. ;;
  1. D PRINTX("TEXT3")
  1. Q
  1. ;
  1. ;
  1. ;----------
  1. TEXT33 ;EP
  1. ;;
  1. ;;Okay.
  1. ;;Please confirm that you wish Inactivate all Lot Numbers that
  1. ;;either have EXPIRED or have NO Expiration Eate, by typing "YES"
  1. ;;a second time. (Enter NO to discontinue this process.)
  1. ;;
  1. D PRINTX("TEXT33")
  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. EXIT ;EP
  1. ;---> End of job cleanup.
  1. D KILLALL^BIUTL8()
  1. K ^TMP("BILOT",$J)
  1. D CLEAR^VALM1
  1. D FULL^VALM1
  1. Q