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

PSOOCKV1.m

Go to the documentation of this file.
PSOOCKV1 ; BIR/SAB - displays stored order checks ;01/22/13  02:22
 ;;7.0;OUTPATIENT PHARMACY;**411**;DEC 1997;Build 95
 ;External reference to ^PSS55 supported by DBIA 4826
 ;
UD ;
 S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=" "
 N OLDIEN,UDDOSE,UDSTRT,UDSTOP,UDSEQ,UDDRG,UDSCHED S OLDIEN=IEN
 D PSS431^PSS55(DFN,+ZIEN,"","","PSS55U")
 D PSS433^PSS55(DFN,"PSS55U2")
 S IEN=OLDIEN
 S UDSEQ=0 F  S UDSEQ=$O(^TMP($J,"PSS55U",+ZIEN,"DDRUG",UDSEQ)) Q:UDSEQ=""  I $D(^TMP($J,"PSS55U",+ZIEN,"DDRUG",UDSEQ,.01)) D
 .S (UDDRG,UDSCHED,UDDOSE,UDSTRT,UDSTOP)=""
 .S UDDRG=^TMP($J,"PSS55U",+ZIEN,"DDRUG",UDSEQ,.01)
 .S:$D(^TMP($J,"PSS55U",+ZIEN,26)) UDSCHED=^TMP($J,"PSS55U",+ZIEN,26)
 .S:$D(^TMP($J,"PSS55U",+ZIEN,109)) UDDOSE=^TMP($J,"PSS55U",+ZIEN,109)
 .S:$D(^TMP($J,"PSS55U",+ZIEN,10)) UDSTRT=^TMP($J,"PSS55U",+ZIEN,10)
 .S:$D(^TMP($J,"PSS55U2",+ZIEN,34)) UDSTOP=^TMP($J,"PSS55U2",+ZIEN,34)
 .S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="Clinic Order: "_$P(UDDRG,"^",2)  ;$$GET1^DIQ(55.07,"1,"_ZIEN_","_DFN_",",.01)
 .S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="    Schedule: "_UDSCHED
 .S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="      Dosage: "_UDDOSE
 .S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="  Start Date: "_$S($P(UDSTRT,"^",2)'="":$P(UDSTRT,"^",2),1:"********")
 .S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)="   Stop Date: "_$S($P(UDSTOP,"^",2)'="":$P(UDSTOP,"^",2),1:"********")
 K ^TMP($J,"PSS55U"),^TMP($J,"PSS55U2")
 S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=" "
 Q
 ;
IV ;
 S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=" "
 N OLDIEN,IVSTRT,IVSTOP,ADDNAM,ADDSTR,ADDSEQ,ADDBOT,SOLSEQ,IVSCHED,DA,DIE,DR,DIC,DIQ,ADDIA,INFUSE,INFUSE2,SOLSTR,SOLNAM
 K ^UTILITY("DIQ1",$J)
 S OLDIEN=IEN
 D PSS436^PSS55(DFN,+ZIEN,"PSS55ICL")
 Q:'$P($G(^TMP($J,"PSS55ICL",0)),"^")
 S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=" "
 S IEN=OLDIEN,IVSCHED=""
 S X="Clinic Order: ",ADDSEQ=0,(IVSTRT,IVSTOP,IVSCHED)=""
 S:$D(^TMP($J,"PSS55ICL",+ZIEN,.02)) IVSTRT=^TMP($J,"PSS55ICL",+ZIEN,.02),IVSTRT=$P(IVSTRT,"^",2)
 S:$D(^TMP($J,"PSS55ICL",+ZIEN,.03)) IVSTOP=^TMP($J,"PSS55ICL",+ZIEN,.03),IVSTOP=$P(IVSTOP,"^",2)
 S:$D(^TMP($J,"PSS55ICL",+ZIEN,.09)) IVSCHED=^TMP($J,"PSS55ICL",+ZIEN,.09)
 F  S ADDSEQ=$O(^TMP($J,"PSS55ICL",+ZIEN,"ADD",ADDSEQ)) Q:ADDSEQ=""  D
 .S (ADDNAM,ADDSTR,ADDBOT,INFUSE)=""
 .S:$D(^TMP($J,"PSS55ICL",+ZIEN,"ADD",ADDSEQ,.01)) ADDNAM=$P(^TMP($J,"PSS55ICL",+ZIEN,"ADD",ADDSEQ,.01),"^",2)
 .S:$D(^TMP($J,"PSS55ICL",+ZIEN,"ADD",ADDSEQ,.02)) ADDSTR=^TMP($J,"PSS55ICL",+ZIEN,"ADD",ADDSEQ,.02)
 .S:$D(^TMP($J,"PSS55ICL",+ZIEN,"ADD",ADDSEQ,.03)) ADDBOT=^TMP($J,"PSS55ICL",+ZIEN,"ADD",ADDSEQ,.03)
 .Q:ADDNAM=""
 .S ADDIA=""
 .I $D(ADD(+ZIEN)) S ADDIA=ADD(+ZIEN)
 .S X=X_$S(ADDIA[ADDNAM:"*",1:" ")_ADDNAM_" "_ADDSTR S:ADDBOT'="" X=X_" ("_ADDBOT_")"
 .S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=X,X="              "
 S X="               in ",SOLSEQ=0
 F  S SOLSEQ=$O(^TMP($J,"PSS55ICL",+ZIEN,"SOL",SOLSEQ)) Q:SOLSEQ=""  D
 .S (SOLNAM,SOLSTR,INFUSE,INFUSE2)=""
 .I $D(^TMP($J,"PSS55ICL",+ZIEN,"SOL",SOLSEQ,.01)) S SOLNAM=$P(^TMP($J,"PSS55ICL",+ZIEN,"SOL",SOLSEQ,.01),"^",2)
 .I $D(^TMP($J,"PSS55ICL",+ZIEN,"SOL",SOLSEQ,1)) S SOLSTR=^TMP($J,"PSS55ICL",+ZIEN,"SOL",SOLSEQ,1)
 .I $D(^TMP($J,"PSS55ICL",+ZIEN,.08)) S INFUSE=^TMP($J,"PSS55ICL",+ZIEN,.08),INFUSE=$P(INFUSE,"@")
 .Q:SOLNAM=""
 .S X=X_SOLNAM_" "_$P(SOLSTR,"^",2)_" @ "_INFUSE,IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=X,X="                  "
 S X="    Schedule: "_IVSCHED
 S X="  Start Date: "_IVSTRT,IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=X
 S X="   Stop Date: "_IVSTOP,IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=X
 S IEN=IEN+1,^TMP("PSOAL",$J,IEN,0)=" "
 K ^TMP($J,"PSS55ICL"),X
 Q