source: FOIAVistA/trunk/r/PHARMACY_DATA_MANAGEMENT-PSS/PSSDIN.m@ 808

Last change on this file since 808 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.5 KB
Line 
1PSSDIN ;BIR/WRT-API for National Formulary Indicator ;03/13/00
2 ;;1.0;PHARMACY DATA MANAGEMENT;**38**;9/30/97
3 ;
4 ; Input: PSSOI=Orderable Item (optional), PSSDD=Dispense Drug(optional)
5 ; Output: ^TMP("PSSDIN",$J,"OI",PSSOI,dtien,index)=text
6 ; Output: ^TMP("PSSDIN",$J,"DD",PSSDD,dtien,index)=text
7 ;
8EN(PSSOI,PSSDD) ;entry point returns nfi text
9 K ^TMP("PSSDIN",$J) N IDX,IEN,WP,TY,TD
10 I $D(PSSOI),$G(PSSOI) D OITM
11 I $D(PSSDD),$G(PSSDD) D DPDRG
12 Q
13OITM ;returns nfi text for a single orderable item
14 Q:'$O(^PS(50.7,PSSOI,1,0))
15 S TY="OI",TD=PSSOI F IDX=0:0 S IDX=$O(^PS(50.7,TD,1,IDX)) Q:'IDX S IEN=$P($G(^PS(50.7,PSSOI,1,IDX,0)),"^") D FTX
16 Q
17FTX I $G(IEN),$D(^PS(51.7,IEN)) D:$P($G(^PS(51.7,IEN,0)),"^",2)=""!($P($G(^PS(51.7,IEN,0)),"^",2)>(DT-1))
18 .F WP=0:0 S WP=$O(^PS(51.7,IEN,2,WP)) Q:'WP S:$D(^PS(51.7,IEN,2,WP,0)) ^TMP("PSSDIN",$J,TY,TD,IEN,WP)=^PS(51.7,IEN,2,WP,0)
19 Q
20DPDRG ;returns nfi text for a single dispense drug
21 Q:'$O(^PSDRUG(PSSDD,9,0))
22 S TY="DD",TD=PSSDD F IDX=0:0 S IDX=$O(^PSDRUG(TD,9,IDX)) Q:'IDX S IEN=$P($G(^PSDRUG(PSSDD,9,IDX,0)),"^") D FTX
23 Q
24PROMPT() ;conditional read
25 Q:'$O(^TMP("PSSDIN",$J,"OI",0))&('$O(^TMP("PSSDIN",$J,"DD",0))) ""
26 S PSSOI=$O(^TMP("PSSDIN",$J,"OI",0)),PSSDD=$O(^TMP("PSSDIN",$J,"DD",0))
27READ1 K DIR S DIR(0)="SB^N:NO"_$S($G(PSSDD):";D:DISPENSE DRUG",1:"")_$S($G(PSSOI):";O:ORDERABLE ITEM",1:"")_$S($G(PSSDD)&($G(PSSOI)):";B:ORDERABLE ITEM AND DISPENSE DRUG",1:"")
28 S DIR("A")=" Restriction/Guideline(s) exist. Display? ",DIR("B")="No" D ^DIR K DIR,PSSOI,PSSDD
29 Q $S(Y="B":"Y",1:Y)
Note: See TracBrowser for help on using the repository browser.