source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOQ0595.m@ 767

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

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1PSOQ0595 ;HINES/RMS - TIU OBJECT FOR REMOTE MEDS VIA RDI ; 30 Nov 2007 7:54 AM
2 ;;7.0;OUTPATIENT PHARMACY;**294**;DEC 1997;Build 13
3 ;
4 ;Reference to CKP^GMTSUP supported by DBIA 4231
5 ;References to ORRDI1 supported by DBIA 4659
6RDI(DFN,TARGET) ;
7 ;OBJECT METHOD IS: S X=$$RDI^PSOQ0595(DFN,"^TMP($J,""PSOQRDI"")")
8 K @TARGET
9 N PSOQHDR,PSOQRET,PSOQMED,PSOQLINE,PSOQQTY,PSOQSIG,PSOQSTAT,PSOQRDI,PSOQDOWN
10 G:'$G(DFN) RDIOUT
11 S PSOQHDR=$$HAVEHDR^ORRDI1 I '+$G(PSOQHDR) D G RDIOUT
12 . S @TARGET@(1,0)="Remote Data from HDR not available"
13 D G:$G(PSOQDOWN) RDIOUT
14 . I $D(^XTMP("ORRDI","OUTAGE INFO","DOWN")) H $$GET^XPAR("ALL","ORRDI PING FREQ")/2
15 . I $D(^XTMP("ORRDI","OUTAGE INFO","DOWN")) S PSOQDOWN=1 D
16 .. S @TARGET@(1,0)="WARNING: Connection to Remote Data Currently Down"
17 D ;RDI/HDR CALL ENCAPSULATION
18 . D SAVDEV^%ZISUTL("PSOQHFS")
19 . S PSOQRET=$$GET^ORRDI1(DFN,"PSOO")
20 . D USE^%ZISUTL("PSOQHFS")
21 . D RMDEV^%ZISUTL("PSOQHFS")
22 I PSOQRET=-1 D G RDIOUT
23 . S @TARGET@(1,0)="Connection to Remote Data Not Available"
24 I '$D(^XTMP("ORRDI","PSOO",DFN)) D G RDIOUT
25 . S @TARGET@(1,0)="No Remote Data available for this patient"
26OBJ S PSOQLINE=3
27 S PSOQMED=0 F S PSOQMED=$O(^XTMP("ORRDI","PSOO",DFN,PSOQMED)) Q:'+PSOQMED D
28 . S PSOQSTAT=$G(^XTMP("ORRDI","PSOO",DFN,PSOQMED,5,0))
29 . Q:"ACTIVE^SUSPENDED"'[PSOQSTAT
30 . S @TARGET@(PSOQLINE,0)=$G(^XTMP("ORRDI","PSOO",DFN,PSOQMED,2,0)) D INC
31 . S PSOQSIG=$G(^XTMP("ORRDI","PSOO",DFN,PSOQMED,14,0)) D ;
32 .. I $L(PSOQSIG)>60 D D INC Q
33 ... N WORDS,COUNT
34 ... S WORDS=$L(PSOQSIG," ")
35 ... S @TARGET@(PSOQLINE,0)="Sig: "
36 ... F COUNT=1:1:WORDS D
37 .... S @TARGET@(PSOQLINE,0)=$G(@TARGET@(PSOQLINE,0))_$P(PSOQSIG," ",COUNT)_" "
38 .... I $L(@TARGET@(PSOQLINE,0))>60 D INC S @TARGET@(PSOQLINE,0)=" "
39 .. S @TARGET@(PSOQLINE,0)="Sig: "_PSOQSIG D INC
40 . S PSOQQTY=$G(^XTMP("ORRDI","PSOO",DFN,PSOQMED,6,0)) S @TARGET@(PSOQLINE,0)="Quantity: "_+$P(PSOQQTY,";")_" Days Supply: "_$P($P(PSOQQTY,";",2),"D",2) D INC
41 . S @TARGET@(PSOQLINE,0)=$G(^XTMP("ORRDI","PSOO",DFN,PSOQMED,10,0))_" refills remaining until "_$G(^XTMP("ORRDI","PSOO",DFN,PSOQMED,7,0)) D INC
42 . S @TARGET@(PSOQLINE,0)="Last filled "_$G(^XTMP("ORRDI","PSOO",DFN,PSOQMED,9,0))_" at "_$G(^XTMP("ORRDI","PSOO",DFN,PSOQMED,1,0))_" ("_$S(PSOQSTAT["ACT":"Active",PSOQSTAT["SUSP":"Active/Suspended",1:"Status Unknown")_")" D INC
43 . S @TARGET@(PSOQLINE,0)=" " D INC
44 I PSOQLINE=3 D G RDIOUT
45 . S @TARGET@(1,0)="No Active Remote Medications for this patient"
46 S @TARGET@(1,0)="Active Medications from Remote Data",@TARGET@(2,0)=" "
47RDIOUT Q "~@"_$NA(@TARGET)
48INC S PSOQLINE=$G(PSOQLINE)+1 Q
49 ;-----------------------------
50ENHS ;ENTRY POINT OF REMOTE DATA MEDICATIONS AS A HEALTH SUMMARY
51 N PSOQHS,PSOQWRT
52 Q:'$G(DFN)
53 S PSOQHS=$$RDI(DFN,"^TMP($J,""PSOQRDI"")")
54 S PSOQWRT=0 F S PSOQWRT=$O(^TMP($J,"PSOQRDI",PSOQWRT)) Q:'+PSOQWRT D
55 . D CKP^GMTSUP Q:$D(GMTSQIT)
56 . W !,^TMP($J,"PSOQRDI",PSOQWRT,0)
57 . D CKP^GMTSUP Q:$D(GMTSQIT)
58 Q
Note: See TracBrowser for help on using the repository browser.