source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORDV06A.m@ 811

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

initial load of FOIAVistA 6/30/08 version

File size: 2.3 KB
Line 
1ORDV06A ; slc/dcm - OE/RR Report Extracts ;3/8/04 11:17
2 ;;3.0;ORDER ENTRY RESULTS REPORTING;**215**;Dec 17, 1997
3 ;Pharmacy Extracts
4NVA(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ;All Outpatient Pharmacy
5 ;Call to PSOHCSUM
6 ;^TMP("PSOO",$J,"NVA",n,0)=Herbal/OTC/Non VA Medication^status (active or discontinued)^start date(fm format)^cprs order # (ptr to 100)
7 ; ^date/time documented (fm format)^documented by (ptr to 200_";"_.01)^dc date/time(fm format)
8 ;^TMP("PSOO",$J,"NVA",n,1,0)=dosage^med route^schedule (previous 3 fields are Instructions)^drug (file #50_";"_.01)^clinic (file #44_";"_.01)
9 ;^TMP("PSOO",$J,"NVA",n,"DSC",nn,0)=statement/explanation/comments
10 I $L($T(GCPR^OMGCOAS1)) D ; Call if FHIE station 200
11 . N BEG,END,MAX
12 . S BEG=0,END=9999999,MAX=9999
13 . D GCPR^OMGCOAS1(DFN,"RXOP",BEG,END,MAX)
14 ;
15 N GO
16 Q:'$L(OREXT)
17 S GO=$P(OREXT,";")_"^"_$P(OREXT,";",2)
18 Q:'$L($T(@GO))
19 D GET
20 Q
21GET N J,ORDT,ORDRGIEN,ORDRG,ORRXNO,ORSTAT,ORQTY,OREXP,ORISSUE,ORLAST,ORREF,ORPRVD,ORCOST,ORSIG,ORX0,ORX1
22 N ECD,GMR,GMW,IX,PSOBEGIN,GMTSNDM,GMTS1,GMTS2,ORSITE,SITE
23 S ORSITE=$$SITE^VASITE,ORSITE=$P(ORSITE,"^",2)_";"_$P(ORSITE,"^",3)
24 S PSOBEGIN=0
25 K ^TMP("ORDATA")
26 I '$L($T(GCPR^OMGCOAS1)) D
27 . K ^TMP("PSOO",$J)
28 . D @GO
29 S ORDT=0
30 F S ORDT=$O(^TMP("PSOO",$J,"NVA",ORDT)) Q:(ORDT'>0) S ORX0=$G(^(ORDT,0)) I ORX0'="" S ORX1=$G(^(1,0)) D
31 . S SITE=$S($L($G(^TMP("PSOO",$J,"NVA",ORDT,"facility"))):^("facility"),1:ORSITE)
32 . S ^TMP("ORDATA",$J,ORDT,"WP",1)="1^"_SITE ;Station ID
33 . S ^TMP("ORDATA",$J,ORDT,"WP",2)="2^"_$P(ORX0,U) ;Herbal/OTC/Non VA Medication
34 . S ^TMP("ORDATA",$J,ORDT,"WP",3)="3^"_$P(ORX0,U,2) ;Status
35 . S ^TMP("ORDATA",$J,ORDT,"WP",4)="4^"_$$DATE^ORDVU($P(ORX0,U,3)) ;Start Date
36 . S ^TMP("ORDATA",$J,ORDT,"WP",5)="5^"_$$DATE^ORDVU($P(ORX0,U,5)) ;Date Documented
37 . S ^TMP("ORDATA",$J,ORDT,"WP",6)="6^"_$P($P(ORX0,U,6),";",2) ;Documented By
38 . S ^TMP("ORDATA",$J,ORDT,"WP",7)="7^"_$$DATE^ORDVU($P(ORX0,U,7)) ;Date DC'd
39 . S ^TMP("ORDATA",$J,ORDT,"WP",8)="8^"_$P(ORX1,U)_" "_$P(ORX1,U,2)_" "_$P(ORX1,U,3) ;SIG dose + route + schedule
40 . S J=0
41 . F S J=$O(^TMP("PSOO",$J,"NVA",ORDT,"DSC",J)) Q:'J S X=^(J,0),^TMP("ORDATA",$J,ORDT,"WP",10,J)="10^"_X
42 . I $O(^TMP("PSOO",$J,"NVA",ORDT,"DSC",1)) S ^TMP("ORDATA",$J,ORDT,"WP",9)="9^[+]" ;flag for detail
43 K ^TMP("PSOO",$J)
44 S ROOT=$NA(^TMP("ORDATA",$J))
45 Q
Note: See TracBrowser for help on using the repository browser.