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

ABSPOSIW.m

Go to the documentation of this file.
  1. ABSPOSIW ; IHS/FCS/DRS - Old-style input ;
  1. ;;1.0;PHARMACY POINT OF SALE;;JUN 21, 2001
  1. ; overflow from ABSPOSIV
  1. BACKLOG() ;EP - from ABSPOSIV
  1. ; a rough guess on how many seconds of backlog there are
  1. N STATS,LOCK,TALLY S LOCK=1,TALLY=0
  1. D FETSTAT^ABSPOS2("STATS(1)")
  1. N A S A="" F S A=$O(STATS(1,A)) Q:'A D
  1. . S TALLY=STATS(1,A)*7 ; 7 seconds of packet preparation & overhead
  1. D FETPKTQ^ABSPOS2("STATS(2)")
  1. N CLAIMS S CLAIMS=$G(STATS(2,"C")) ; figure about 12 secs each
  1. N RESPS S RESPS=$G(STATS(2,"R")) ; figure about 3 secs each
  1. S TALLY=CLAIMS*12+(RESPS*3)+TALLY ;
  1. S TALLY=CLAIMS*20+TALLY ; and 20 secs dialing for each one (EOT prob)
  1. ;I CLAIMS S TALLY=TALLY+20 ; normally, just 20 secs once
  1. I 0,+$H=58107,$P($H,",",2)<(7*3600) D Q 300
  1. . W "Computed value from $$BACKLOG=",TALLY," but change it for testing.",!
  1. Q TALLY
  1. GETNDC() ;EP - from ABSPOSIV
  1. ;Prompt - get NDC #
  1. ; Returns the NDC # with the "-"
  1. ; Even if pure numeric input, figure it out and put in the "-"
  1. ; "^" OR "^^" or "" if the user inputs one of those
  1. ; 0 if automatic answer input was a bad number
  1. ;
  1. ; Don't default it - they want the real, true number to always be
  1. ; scanned in from the bottle, every time.
  1. ;
  1. N X,NDCDEF
  1. NDC0 I DEFNDCNO S NDCDEF=$$DEFNDC^ABSPOSIV ; relies on ABSBRXI, ABSBRXR
  1. E S NDCDEF=""
  1. S X=$$FREETEXT^ABSPOSU2("NDC#: ",NDCDEF,1,1,15,$G(DTIME))
  1. ;
  1. ; "the Abbot Labs bar codes are really funky"
  1. I X?1"++3"10.11N2E D
  1. . S X=$E(X,4,$L(X)-2) ; strip off the surrounding junk
  1. . ; fine if it's 11N
  1. . ; if it's 10N, what? leave it to the mercy of the $$NDC10^ABSPOS9?
  1. I "^^"[X Q X ;I X="^^" Q X ;Q:X=-1 "^" Q:X="" X
  1. ; If it's entirely numeric input, figure out where the "-" go.
  1. I X?10N D
  1. .N Y S Y=$$NDC10^ABSPOS9(X)
  1. .I Y="" W !,"We couldn't figure out ",X,!
  1. .E W " ",Y S X=Y
  1. I X?11N D
  1. .S X=$E(X,1,5)_"-"_$E(X,6,9)_"-"_$E(X,10,11)
  1. I X?12N D ; got to ask Carlene about this
  1. .W !,"12 digit NDC number? We will proceed anyhow, but it's going",!
  1. .W "to be truncated"
  1. .S X=$E(X,1,6)_"-"_$E(X,7,10)_"-"_$E(X,11,12) ; put in 6-4-2 format
  1. .W !
  1. I X?4N1"-"4N1"-"2N G NDC1
  1. I X?5N1"-"3N1"-"2N G NDC1
  1. I X?5N1"-"4N1"-"1N G NDC1
  1. I X?5N1"-"4N1"-"2N G NDC1
  1. I X?6N1"-"4N1"-"2N G NDC1
  1. W:'$G(SILENT) !,"Bad NDC #",! G NDC0
  1. NDC1 ;S $P(^PSRX(ABSBRXI,2),U,7)=X ; store input NDC # in PRESCRIPTION file
  1. ; Don't store it yet - just get input now - let background job store it
  1. W " ",$$NAME^ABSPOS9(X)
  1. Q X ; JUST RETURN WHAT WAS INPUT!!!