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

PXVEDIT.m

Go to the documentation of this file.
  1. PXVEDIT ;BIR/CML3,ADM - LOT NUMBER EDIT ;Nov 30, 2018@14:03
  1. ;;1.0;PCE PATIENT CARE ENCOUNTER;**210,216,217**;Aug 12, 1996;Build 134
  1. ;
  1. EN ; entry point for PXTT EDIT IMMUNIZATION LOT option
  1. N PXVDEF,PXVFAC,PXVFIEN,PXVI,PXVOUT,PXVSTN,PXVTITLE,PXVY,X,Y
  1. S PXVOUT=0,PXVFAC=""
  1. D PICK,LIST I PXVFAC="" D END Q
  1. D PICK1
  1. FUNC ; select function
  1. K DIR
  1. S DIR("A",1)="1. Enter/Edit Immunization Lot"
  1. S DIR("A",2)="2. Transfer Immunization Inventory Between Facilities"
  1. S DIR("A",3)="3. Display/Print Immunization Inventory Report"
  1. S DIR("A",4)=""
  1. S DIR("A")="Enter a number"
  1. S DIR("?",1)=" Enter '1' to update information for an existing immunization lot or"
  1. S DIR("?",2)=" to enter a new immunization lot. Enter '2' to transfer vaccine inventory"
  1. S DIR("?",3)=" from one facility to another. The number of doses to be moved is subtracted"
  1. S DIR("?",4)=" from the transferring facility and added to the receiving facility."
  1. S DIR("?")=" Enter '3' to display or print an immunization inventory report."
  1. S DIR(0)="NO^1:3" D ^DIR K DIR I $D(DTOUT)!$D(DUOUT)!'Y S PXVOUT=1 D END Q
  1. I X["?" G PICK
  1. I Y=2 D EN^PXVTRAN(PXVFIEN,PXVTITLE) D END Q
  1. I Y=3 D ^PXVINV D END Q
  1. F1 ; entry point for lot number enter/edit
  1. N DA,DIE,DIC,DIDEL,DIR,DLAYGO,DR,DTOUT,DUOUT,PXVIEN,X,Y
  1. F D LN Q:PXVOUT
  1. K PXVOUT
  1. Q
  1. LN ; edit lot number or enter new lot number
  1. W @IOF,!,?10,"Enter/Edit Immunization Lot for "_PXVTITLE,!
  1. K DIC S DIC="^AUTTIML(",DIC(0)="AEMLZ",DLAYGO=9999999.41
  1. S DIC("S")="I $P(^(0),""^"",10)=PXVFIEN!($P(^(0),""^"",10)="""")"
  1. S DIC("DR")=".02;.04;.09;.03;.11;.12;.15;.18"
  1. D ^DIC K DIC I $D(DTOUT)!$D(DUOUT)!(X="") S PXVOUT=1 D END Q
  1. S PXVIEN=$P($G(Y),"^")
  1. I $P(Y,"^",3)=1 K DA,DIE,DR S DA=PXVIEN,DIE=9999999.41,DR=".1////"_PXVFIEN D ^DIE D END Q
  1. I $P(^AUTTIML(PXVIEN,0),"^",10)="" D LINK
  1. EDIT ; edit existing lot number
  1. I $D(^AUPNVIMM("LN",PXVIEN)) D D END Q
  1. .W !!,"LOT NUMBER: "_$P(^AUTTIML(PXVIEN,0),"^")_"// ** Already assigned and cannot be edited. **",$C(7)
  1. .S DA=PXVIEN,DIE=9999999.41,DR=".02;.04;.09;.03;.11;.12;.15;.18" D ^DIE
  1. K DA,DIE,DR S DA=PXVIEN,(DIDEL,DIE)=9999999.41,DR=".01;.04;.02;.09;.03;.11;.12;.15;.18" D ^DIE
  1. D END
  1. Q
  1. END K DA,DIE,DIC,DIDEL,DIR,DLAYGO,DR,DTOUT,DUOUT,PXVIEN,X,Y
  1. Q
  1. PICK W @IOF,"IMMUNIZATION INVENTORY FUNCTIONS",!
  1. Q
  1. PICK1 W @IOF,"IMMUNIZATION INVENTORY FUNCTIONS FOR "_PXVTITLE,!
  1. Q
  1. LIST ;
  1. N PXVCT,PXVI,PXVINST,PXVJ,PXVSITE,PXVX,PXVY S PXVCT=0
  1. W !,"Select associated VA facility from the list or enter another facility."
  1. I $O(^AUTTIML("AF",0)) D
  1. .S PXVI=0 F S PXVI=$O(^AUTTIML("AF",PXVI)) Q:'PXVI D SITE
  1. E S PXVI=$$KSP^XUPARAM("INST") D SITE
  1. S PXVI="" F S PXVI=$O(PXVINST(PXVI)) Q:PXVI="" S X=PXVINST(PXVI) D
  1. .W !?10,$P(X,"^",2)_" ("_$P(X,"^",3)_")"
  1. W !,"Inventory information to be updated or displayed will be related to"
  1. W !,"the selected facility.",!
  1. RD K DIR S DIR(0)="9999999.41,.1",DIR("A")="Enter the facility name or station number"
  1. I PXVCT=1 S PXVI="",PXVI=$O(PXVINST(PXVI)),DIR("B")=$P(PXVINST(PXVI),"^",2)
  1. D ^DIR K DIR I $D(DTOUT)!$D(DUOUT) Q
  1. I X="" W !,"This is a required entry." G RD
  1. S PXVFAC=Y,PXVFIEN=+Y
  1. S PXVY=$$GET1^DIQ(4,$P(PXVFAC,"^"),99),PXVFAC=PXVFAC_"^"_PXVY
  1. S PXVTITLE=$P(PXVFAC,"^",2)_" ("_$P(PXVFAC,"^",3)_")"
  1. Q
  1. SITE ;
  1. S PXVSITE=PXVI F PXVJ=.01,99 S PXVX=$$GET1^DIQ(4,PXVI,PXVJ),PXVSITE=PXVSITE_"^"_PXVX
  1. S PXVINST($P(PXVSITE,"^",2))=PXVSITE,PXVCT=PXVCT+1
  1. Q
  1. S DIR("A")="Associate this lot number with "_PXVTITLE,DIR(0)="Y"
  1. S DIR("?",1)=" Enter YES to associate this lot number entry exclusively with this facility."
  1. S DIR("?",2)=" Enter NO if this immunization lot should remain not associated with any"
  1. S DIR("?")=" specific facility or should be associated with a different facility."
  1. D ^DIR K DIR I $D(DTOUT)!$D(DUOUT) Q
  1. I Y K DA,DIE,DR S DA=PXVIEN,(DLAYGO,DIE)=9999999.41,DR=".1////"_PXVFIEN D ^DIE K DA,DIE,DR
  1. Q