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

ABSPOSMA.m

Go to the documentation of this file.
  1. ABSPOSMA ; IHS/FCS/DRS - General Inquiry/Report .57; [ 08/28/2002 3:01 PM ]
  1. ;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
  1. Q
  1. ; General inquiry and reporting on the Transaction File, 9002313.57.
  1. ; First menu selection determines whether you're doing an inquiry
  1. ; or a report.
  1. ; Second menu selection determines how to select transactions.
  1. ; If you're doing an inquiry, do the search only. Then display
  1. ; a list of the claims. Select one or more and then you get the
  1. ; prompt for what kind of output to generate.
  1. ; Third menu selection determines what kind of output to generate.
  1. ; You get this right away if you're operating in report mode.
  1. ;
  1. ; Primary sort is always by date/time, usually transaction date/time.
  1. ; If sorting by released date (date only, can't do it by time),
  1. ; for efficiency, pre-scan 9002313.61 Report Master file and
  1. ; determine a range of transaction date/time to search by.
  1. ;
  1. ; Transaction date/time means the LAST UPDATE field.
  1. ;
  1. ; Local array ABSPOSMA() contains the parameters:
  1. ; ABSPOSMA("BY WHICH DATE")="TRANSACTION" or "RELEASED"
  1. ; ABSPOSMA("MODE")="INQUIRY" or "REPORT"
  1. ; ABSPOSMA("SORT",7,"FR")=transaction date/time, start value
  1. ; ABSPOSMA("SORT",7,"TO")=transaction date/time, to value
  1. ; Released date/time - 9999.95 - is applicable
  1. ; only if ABSPOSMA("BY WHICH DATE")="RELEASED"
  1. ; ABSPOSMA("SORT",9999.95,"FR")=released date/time, start value
  1. ; ABSPOSMA("SORT",9999.95,"TO")=released date/time, to value
  1. ; Other sort fields are always field name, not field number.
  1. ; This way, you can $O(ABSPOSMA("SORT"," ")) to find out
  1. ; what kind of a sort is being done.
  1. ; ABSPOSMA("SORT",field name,"FR")=other field sort, start value
  1. ; ABSPOSMA("SORT",field name,"TO")=other field sort, to value
  1. ;
  1. ; ABSPOSMA("SCREEN",n)=screens, to be copied to DIS(n)
  1. ; ABSPOSMA("OUTPUT TYPE")=see list of codes in ABSPOSMZ
  1. ;
  1. ;-----------------------------------------------------------
  1. ;IHS/SD/lwj 8/28/02 Cache cannot handle a reverse $O of an
  1. ; array, so the logic used to retrieve the last entry in
  1. ; ABSPOSMA("SCREEN") had to be altered somewhat. (subroutine
  1. ; ADDSCREE
  1. ;-----------------------------------------------------------
  1. ;
  1. INIT ; EP - init ABSPOSMA
  1. ; Nice idea for future - retain settings on user-by-user basis
  1. K ABSPOSMA
  1. S ABSPOSMA("BY WHICH DATE")="TRANSACTION"
  1. S (ABSPOSMA("SORT",7,"FR"),ABSPOSMA("SORT",7,"TO"))="?"
  1. S ABSPOSMA("MODE")="INQUIRY"
  1. S ABSPOSMA("OUTPUT TYPE")=$$DEFOUT^ABSPOSMZ
  1. S ABSPOSMA("SCREEN",0)="I $D(^ABSPECX(""RPT"",""AE"",D0))" ; only the most recent transaction for any one given presc. ; 1" ; easier to fill in a dummy here
  1. Q
  1. KILLSORT ; EP - kill all sort fields except the date/time ones
  1. N A S A=0 F S A=$O(ABSPOSMA("SORT",A)) Q:A="" D
  1. . Q:A=7 Q:A=9999.95&(ABSPOSMA("BY WHICH DATE"))="RELEASED"
  1. . K ABSPOSMA("SORT",A)
  1. Q
  1. ADDSCREE(X) ; store the screen, xecutable code stored in X
  1. ;IHS/SD/lwj 8/28/02 Cache cannot do a reverse $O on an array
  1. ; so we had to change the logic used to retrieve the last
  1. ; array entry in ABSPOSMA - nxt line remarked out and
  1. ; the two following were added
  1. ;S ABSPOSMA("SCREEN",$O(ABSPOSMA("SCREEN",""),-1)+1)=X Q
  1. N ABSPL,ABSPLST
  1. S ABSPL=""
  1. F S ABSPL=$O(ABSPOSMA("SCREEN",ABSPL)) Q:ABSPL="" S ABSPLST=ABSPL
  1. S ABSPOSMA("SCREEN",ABSPLST+1)=X Q
  1. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1. ; Handling for each of the ABSP INQUIRY options
  1. ; Each of these does the following:
  1. ; D INIT ; init ABSPOSMA()
  1. ; ; then its own specific setup
  1. ; G JOIN
  1. ; And at JOIN, then all go to JOIN^ABSPOSMB
  1. ; Eventually, EN1^DIP will do all the work for us,
  1. ; both sorting and printing.
  1. JOIN G JOIN^ABSPOSMB
  1. ;
  1. PHARM ; EP - Option ABSP INQUIRY BY PHARMACY
  1. D INIT
  1. N PHARM S PHARM=$$ASKPHARM^ABSPOSMZ
  1. Q:'PHARM
  1. S ABSPOSMA("SORT","PHARMACY","FR")=$P(^ABSP(9002313.56,PHARM,0),U)
  1. S ABSPOSMA("SORT","PHARMACY","TO")=$P(^ABSP(9002313.56,PHARM,0),U)
  1. Q
  1. PATIENT ; EP - Option ABSP INQUIRY BY PATIENT
  1. ; Select a list of patients.
  1. ; Build screens corresponding to the list (i.e., it's not a sort item)
  1. ; I $P(^ABSPTL(D0,0),U,6)=patient ien
  1. D INIT
  1. N PAT F S PAT=$$ASKPAT^ABSPOSMZ Q:'PAT D
  1. . D ADDSCREE("I $P(^ABSPTL(D0,0),U,6)="_PAT)
  1. G JOIN
  1. RESTYPE ; EP - Option ABSP INQUIRY BY RESULT TYPE
  1. ; Select from the entries in file 9002313.83
  1. ; Build screens corresponding to the list (i.e., it's not a sort item)
  1. D INIT
  1. N R F S R=$$ASKRTYPE^ABSPOSMZ Q:R="" D
  1. . D ADDSCREE("I $$GET1^DIQ(9002313.57,D0_"","",""RESULT WITH REVERSAL"")="""_R_"""")
  1. G JOIN
  1. CLAIMID ; EP - Option ABSP INQUIRY BY CLAIM ID
  1. ; A sort criterion. Prompt for FR and TO.
  1. ; Lookup on file 9002313.02 now?
  1. D INIT
  1. D KILLSORT
  1. S ABSPOSMA("SORT","CLAIM:Claim ID","FR")="?"
  1. S ABSPOSMA("SORT","CLAIM:Claim ID","TO")="?"
  1. G JOIN
  1. INSURER ; EP - Option ABSP INQUIRY BY INSURER
  1. D INIT
  1. S ABSPOSMA("SORT","INSURER","FR")="?"
  1. S ABSPOSMA("SORT","INSURER","TO")="?"
  1. G JOIN
  1. NDC ; EP - Option ABSP INQUIRY BY NDC NUMBER
  1. D INIT
  1. W !,"When prompted for NDC number, use the 11-digit form "
  1. W "with no hyphens.",! H 2
  1. S ABSPOSMA("SORT","ABSBNDC","FR")="?"
  1. S ABSPOSMA("SORT","ABSBNDC","TO")="?"
  1. G JOIN
  1. PRICE ; EP - Option ABSP INQUIRY BY PRICE
  1. D INIT
  1. S ABSPOSMA("SORT","TOTAL PRICE","FR")="?"
  1. S ABSPOSMA("SORT","TOTAL PRICE","TO")="?"
  1. G JOIN
  1. FM ; EP - Option ABSP INQUIRY BY FILEMAN
  1. ; we will leave the BY undefined
  1. D INIT
  1. K ABSPOSMA("SORT")
  1. G JOIN
  1. ONLY ; EP - Option ABSP INQUIRY BY DATE ONLY
  1. D INIT
  1. D KILLSORT
  1. G JOIN
  1. TEST D ONLY Q