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

PSUOPAM.m

Go to the documentation of this file.
  1. PSUOPAM ;BIR/DAM - PSU PBM Outpatient AMIS Pharmacy Data Collection; March 2004 ; 1/11/08 11:46am
  1. ;;4.0;PHARMACY BENEFITS MANAGEMENT;**13**;MARCH, 2005;Build 3
  1. ;
  1. ;DBIA's
  1. ;Reference to File (#52) supported by DBIA 1878
  1. ;
  1. EN ;entry point to gather additional AMIS data. Called from PSUOP2
  1. ;
  1. K PSUAM ;Array to hold single dose Medication Instructions
  1. K PSUAMMD ;Array to hold multidose medication instructions
  1. K PSUMDFLG ;Multidose flag
  1. S (PSUPI,PSUCO,PSUEXP,PSUAM,PSUDSG,PSUDIPU,PSUNITS,PSUNOUN)=""
  1. S (PSUDUR,PSUCONJ,PSUROUT,PSUSCHED,PSUVERB)=""
  1. D CO
  1. D EXP
  1. D DOSG
  1. Q
  1. ;
  1. ;
  1. CO ;Copay status: found in file (#52), field (#105)
  1. ;
  1. ;PSU*4*13 Corrected to show the COPAY.
  1. S PSUCO=$P($G(^TMP("PSOR",$J,PSURXIEN,"IB")),U,1)
  1. I $G(PSUCO) S PSUCOPAY="Y"
  1. I '$G(PSUCO) S PSUCOPAY="N"
  1. Q
  1. ;
  1. EXP ;Expanded instructions: found in file (#52), multiple (#113),
  1. ;sub-field (#.01)
  1. ;
  1. S PSUD1=0
  1. F S PSUD1=$O(^TMP("PSOR",$J,PSURXIEN,"PI",PSUD1)) Q:PSUD1="" D
  1. .I PSUD1=1 S PSUEXP=$E(^TMP("PSOR",$J,PSURXIEN,"PI",PSUD1,0),1,80) D
  1. ..S PSUPI=$G(PSUEXP)
  1. .I (PSUD1'=1),($L(PSUEXP)<80) D
  1. ..S PSUEXP=$E(PSUEXP_" "_^TMP("PSOR",$J,PSURXIEN,"PI",PSUD1,0),1,80)
  1. ..S PSUPI=$G(PSUEXP)
  1. ;
  1. Q
  1. ;
  1. DOSG ;Dosage data: found in file (#52), multiple (#113). There are
  1. ;nine sub-fields to be pulled: #.01 through #8
  1. ;
  1. S PSUD1=0
  1. F S PSUD1=$O(^TMP("PSOR",$J,PSURXIEN,"MI",PSUD1)) Q:PSUD1="" D
  1. .I PSUD1'=1 S PSUMDFLG="M" ;Multidose flag
  1. .I PSUD1=1 D ;Single dose/first Multidose data
  1. ..S PSUAM=^TMP("PSOR",$J,PSURXIEN,"MI",PSUD1,0)
  1. ..S PSUDSG=$P(PSUAM,U,1) ;Dosage Ordered
  1. ..S PSUDISPU=$P(PSUAM,U,2) ;Dispense Units per Dose
  1. ..S PSUNITS=$P($P(PSUAM,U,3),";",2) ;Units
  1. ..S PSUNOUN=$P(PSUAM,U,4) ;Noun
  1. ..S PSUDUR=$P(PSUAM,U,5) ;Duration
  1. ..S PSUCONJ=$P(PSUAM,U,6) ;Conjunction
  1. ..S PSUROUT=$P($P(PSUAM,U,7),";",2) ;Route
  1. ..S PSUSCHED=$P(PSUAM,U,8) ;Schedule
  1. ..S PSUVERB=$P(PSUAM,U,9) ;Verb
  1. ;
  1. Q
  1. ;
  1. MULTI ;Set variables for Multidose Medication Instructions
  1. ;Called from PSUOP3
  1. ;
  1. S (PSUDSGMD,PSUDSPMD,PSUNITMD,PSUNMD)=""
  1. S (PSURTMD,PSUSCHMD,PSUVRBMD)=""
  1. ;
  1. S PSUDSGMD=$P(PSUAMMD,U,1) ;Dosage Ordered
  1. S PSUDSPMD=$P(PSUAMMD,U,2) ;Dispense Units per Dose
  1. S PSUNITMD=$P($P(PSUAMMD,U,3),";",2) ;Units
  1. S PSUNMD=$P(PSUAMMD,U,4) ;Noun
  1. S PSUDURMD=$P(PSUAMMD,U,5) ;Duration
  1. S PSUCONMD=$P(PSUAMMD,U,6) ;Conjunction
  1. S PSURTMD=$P($P(PSUAMMD,U,7),";",2) ;Route
  1. S PSUSCHMD=$P(PSUAMMD,U,8) ;Schedule
  1. S PSUVRBMD=$P(PSUAMMD,U,9) ;Verb
  1. ;
  1. Q