[613] | 1 | PSS781 ;BHM/DB - API FOR PHARMACY PATIENT FILE ; 15 JUN 05
|
---|
| 2 | ;;1.0;PHARMACY DATA MANAGEMENT;**106**;9/30/97
|
---|
| 3 | PSS(PSSDFN,PSSNUM,LIST) ;
|
---|
| 4 | ;PSSDFN: IEN of Patient [REQUIRED]
|
---|
| 5 | ;PSSNUM: CLOZAPINE REGISTRATION NUMBER
|
---|
| 6 | ;LIST: Subscript name used in ^TMP global [REQUIRED]
|
---|
| 7 | I $G(LIST)="" Q
|
---|
| 8 | K ^TMP($J,LIST) N PSSIEN,DA,DR,DIC
|
---|
| 9 | I $G(PSSDFN)'>0,$G(PSSNUM)="" S ^TMP($J,LIST,0)=-1_"^"_"NO DATA FOUND" Q
|
---|
| 10 | I $G(PSSNUM)'="",$G(PSSDFN)'>0 S PSSDFN=$O(^PS(55,"ASAND1",PSSNUM,0)) I $G(PSSDFN)'>0 G NODATA
|
---|
| 11 | S PSSIEN=$G(PSSDFN) K ^UTILITY("DIQ1",$J),DIQ
|
---|
| 12 | S (DA,IEN)=PSSDFN,DIC=55,DR="53:58",DIQ(0)="IE" D EN^DIQ1 I '$D(^UTILITY("DIQ1",$J)) G NODATA
|
---|
| 13 | F PSSIEN=53:1:58 S ^TMP($J,LIST,PSSDFN,PSSIEN)=$G(^UTILITY("DIQ1",$J,55,IEN,PSSIEN,"I"))
|
---|
| 14 | F PSSIEN=54,55,56,57,58 S ^TMP($J,LIST,PSSDFN,PSSIEN)=$S($G(^UTILITY("DIQ1",$J,55,IEN,PSSIEN,"I"))=$G(^UTILITY("DIQ1",$J,55,IEN,PSSIEN,"E")):"",1:^TMP($J,LIST,PSSDFN,PSSIEN))_"^"_$G(^UTILITY("DIQ1",$J,55,IEN,PSSIEN,"E"))
|
---|
| 15 | F X=53:1:58 I $G(^TMP($J,LIST,PSSDFN,X))="^" S ^TMP($J,LIST,PSSDFN,X)=""
|
---|
| 16 | K ^UTILITY("DIQ1",$J),DIQ,DIC,DA Q
|
---|
| 17 | NODATA S ^TMP($J,LIST,0)="-1^NO DATA FOUND"
|
---|
| 18 | Q Q
|
---|
| 19 | WRT(PSSDFN,PSSSTAT,LIST) ;Sets Clozapine Status field for Mental Health
|
---|
| 20 | ;PSSDFN = DFN of Patient (REQUIRED)
|
---|
| 21 | ;PSSSTAT = Clozapine Status (REQUIRED)
|
---|
| 22 | ;LIST: Subscript name used in ^TMP global [REQUIRED]
|
---|
| 23 | I $G(PSSDFN)'>0 Q
|
---|
| 24 | I $G(PSSSTAT)="" Q
|
---|
| 25 | I $G(LIST)="" Q
|
---|
| 26 | I '$D(^PS(55,PSSDFN)) S ^TMP($J,LIST,0)=0 Q
|
---|
| 27 | I $G(PSSSTAT)'="D",$G(PSSSTAT)'="H",$G(PSSSTAT)'="A" S ^TMP($J,LIST,0)=0 Q
|
---|
| 28 | S $P(^PS(55,PSSDFN,"SAND"),"^",2)=PSSSTAT,^TMP($J,LIST,0)=1 Q
|
---|