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

BXPARUTL.m

Go to the documentation of this file.
BXPARUTL ;IHS/OIT/FBD - PARAMETER AUDIT REPORT UTILITIES ;
 ;;1.0;IHS EXTENSIONS TO KERNEL TOOLKIT;;Dec 19, 2013;Build 12
 ;
 ;
DATESEL ;SPECIFY DATE RANGE OF REPORT
 K BXPABDT,BXPAEDT
 NEW Y
 S BXPABDT=$$DATE("B")  ;BEGINNING DATE OF DATE RANGE
 I +BXPABDT'>0 S BXPAEXIT=1 Q
 S BXPAEDT=$$DATE("E")  ;ENDING DATE OF DATE RANGE
 I +BXPAEDT'>0 S BXPAEXIT=1
 Q
 ;
DATE(SPEC) ;SELECT DATE
 ;INPUT:
 ; SPEC   DATE SPECIFICATION
 ;         "B" = BEGINNING DATE OF DATE RANGE
 ;         "E" = ENDING DATE OF DATE RANGE
 ;RETURNED VALUE:
 ; POSITIVE VALUE = SELECTED DATE (FM INTERNAL FORMAT)
 ; ZERO (0) VALUE = NO DATE SPECIFIED
 ;
 NEW DIR,DATE,PROMPT,BXBSLD
 I $G(DT)="" D DT^DICRW
 S DATE=0
 S PROMPT=$S(SPEC="B":"beginning",SPEC="E":"ending")
 I SPEC="B" D  ;OPEN RANGE ON BEGINNING DATE,
 .S BXBSLD=$O(^BXPA(9002026.01,"B",""))\1
 .S DIR(0)="D^"_BXBSLD_":"_DT_".2359:AETX"
 E  D  ;BUT ENDING DATE MUST FOLLOW BEGINNING DATE
 .S DIR(0)="D^"_BXPABDT_":"_DT_".2359:AETX"
 S DIR("A")="Enter "_PROMPT_" date of report date range: "
 D ^DIR
 I +Y S DATE=+Y
 E  S:$D(DIRUT) BXPAEXIT=1  ;SET FLAG IF USER ABORTED ENTRY
 Q DATE
 ;
PROVSEL ;PROVIDER SELECTION
 K BXPAPRV
 NEW DIR,X,Y,BXPAPIEN,BXPAUNM,BXPASEL
 S DIR(0)="S^IP:Individual Provider;SEL:Selected Providers (User Defined);TAX:Provider Taxonomy List"
 S DIR("A")="Enter Selection" D ^DIR
 S BXPASEL=Y
 I BXPASEL="SEL" D PROVMAN
 I BXPASEL="IP" D PROVPICK
 I BXPASEL="TAX" D PROVTAX
 I $D(DIRUT) S BXPAEXIT=1 Q
 Q
 ;
VALPROV(IEN,BDATE,EDATE) ;FUNCTION TO CHECK IF A 
 Q
 ;
ITMSEL ;EP - Select Audit items
 NEW ITMDONE,BXIEN,BXPINM
 K BXPAITM
 S ITMDONE=0,BXPAEXIT=0
 W !!,"Parameter Selection",!
 W !,"You may select one or more Parameters."
 W !,"Press the <Enter> key without entering a name to conclude the selection process."
 W !,"Enter ""^"" to abort the selection process.",!
 F  D  Q:ITMDONE
 .D ITMPICK Q:ITMDONE
 .S BXPAITM(BXPINM)=""
 I 'BXPAEXIT,'$D(BXPAITM) S BXPAEXIT=1 Q
 Q
 ;
ITMPICK ;
 NEW DIC,DA,GLOBROOT,MSG
 S BXPAEXIT=0
 S DIC="^BXPA(9002026.02,",DIC(0)="AEMQ"
 S DIC("A")="Select a Parameter: "
 D ^DIC K DIC
 I +Y>0 D  ;PROCESS SELECTION
 .S BXIEN=+Y
 .S BXPINM=$P(^BXPA(9002026.02,BXIEN,0),U,1)
 E  D  ;EXITING - SET FLAGS FOR WHY
 .S ITMDONE=1
 .S:$D(DTOUT) BXPAEXIT=1
 Q
 ;
PROVMAN ;MANUAL PROVIDER SELECTION - USER SELECTS ONE OR MORE PROVIDERS INDIVIDUALLY
 S BXPAEXIT=0,PRVDONE=0 ;FLAG FOR ABORTING PROCESS
 W !!,"Manual Provider Selection",!
 W !,"You may select one or more providers."
 W !,"Press the <Enter> key without entering a name to conclude the selection process."
 W !,"Enter ""^"" to abort the selection process.",!
 F  D  Q:PRVDONE
 .D PROVPICK Q:PRVDONE
 .S BXPAPRV(BXPAPIEN)=BXPAUNM
 I 'BXPAEXIT,'$D(BXPAPRV) S BXPAEXIT=1
 Q
 ;
PROVPICK ;SELECT AN INDIVIDUAL PROVIDER
 ;EXIT VALUE(S):
 ; BPXAUSER>0  BPXAUSER = FILE 200 IEN
 ; BPXAUSER=0  USER CONCLUDED QUERY PROCESS
 ; BPXAEXIT=1  USER ABORTED QUERY PROCESS
 NEW DIC,DA,GLOBROOT,MSG
 S BXPAEXIT=0
 S (DIC,GLOBROOT)="^VA(200,"
 S DIC(0)="AEMQ"
 S DIC("A")="Select a provider: "
 S DIC("S")="I $D(^VA(200,""AK.PROVIDER"",$P($G(^VA(200,+Y,0)),U),+Y))"
 D ^DIC K DIC
 I +Y>0 D  ;PROCESS SELECTION
 .S BXPAPIEN=+Y  ;NEW USER FILE #200 RECORD POINTER
 .S BXPAUNM=$P(^VA(200,BXPAPIEN,0),U,1)  ;USER NAME
 .S BXPAPRV(BXPAPIEN)=BXPAUNM
 E  D  ;EXITING - SET FLAGS FOR WHY
 .S PRVDONE=1
 .S:$D(DTOUT) BXPAEXIT=1
 I 'BXPAEXIT,'$D(BXPAPRV) S BXPAEXIT=1
 Q
 ;
PROVTAX ;SELECT PROVIDERS BASED ON AN EXISTING PROVIDER TAXONOMY
 NEW DIC,DA,BXN,BXTAX,BXPAUNM,BXPAPIEN
 K BXPAPROV
 S DIC="^ATXAX("
 S DIC(0)="AEMQ"
 S DIC("S")="I $P(^ATXAX(+Y,0),U,15)=200"
 S DIC("A")="Select provider taxonomy: "
 D ^DIC K DIC
 I +Y>0 D  ;SCAN SPECIFIED TAXONOMY & EXTRACT SPECIFIED PROVIDERS
 .S BXTAX=+Y,BXN=0
 .F  S BXN=$O(^ATXAX(BXTAX,21,BXN)) Q:'BXN  D
 ..S BXPAPIEN=$P(^ATXAX(BXTAX,21,BXN,0),U,1)
 ..S BXPAUNM=$P($G(^VA(200,BXPAPIEN,0)),U,1)
 ..I BXPAUNM'="" S BXPAPRV(BXPAPIEN)=BXPAUNM
 E  D  ;EXITING - SET FLAGS FOR WHY
 .S PRVDONE=1
 .S:$D(DTOUT) BXPAEXIT=1
 I 'BXPAEXIT,'$D(BXPAPRV) S BXPAEXIT=1
 Q
 ;
HIST(BXPAPRM,BXPADT) ;EP-History of parameter
 NEW PARIEN,BXI,DATE,STAT
 S PARIEN=$O(^BXPA(9002026.02,"B",BXPAPRM,"")) I PARIEN="" Q
 S BXI=0
 F  S BXI=$O(^BXPA(9002026.02,PARIEN,11,BXI)) Q:'BXI  D
 .S DATE=$P(^BXPA(9002026.02,PARIEN,11,BXI,0),U,1)\1
 .NEW DA,IENS
 .S DA(1)=PARIEN,DA=BXI,IENS=$$IENS^DILF(.DA)
 .S STAT=$$GET1^DIQ(9002026.21101,IENS,1,"E")
 .S BXPADT(BXPAPRM,DATE,STAT)=""
 Q