source: WorldVistAEHR/trunk/r/PHARMACY_DATA_MANAGEMENT-PSS/PSS55MIS.m@ 1195

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

initial load of WorldVistAEHR

File size: 1.7 KB
Line 
1PSS55MIS ;BIR/TSS - API FOR VARIOUS DATA FROM PHARMACY PATIENT FILE; 5 Sep 03
2 ;;1.0;PHARMACY DATA MANAGEMENT;**112**;9/30/97;Build 30
3STATUS(PSSFILE,PSSFIELD,LIST) ;
4 ;PSSFILE - FILE NUMBER (VALIDATED AGAINST "FILES" LINE-TAG BELOW)
5 ;PSSFIELD - FIELD NUMBER FROM FILE
6 ;LIST - NAME OF LOCAL ARRAY RETURNED
7 ;Returns the set of codes valid for the status field
8 S PSSDIY=""
9 Q:'$G(PSSFILE) Q:'$G(PSSFIELD) Q:$G(LIST)=""
10 N PSSTEST S PSSTEST=$$VALID(PSSFILE,PSSFIELD)
11 I PSSTEST'>0 S PSSDIY=-1 Q
12 D FIELD^DID(PSSFILE,PSSFIELD,"","POINTER",LIST) Q
13VALID(PSTFILE,PSTFIELD) ;TEST FOR VALID DATA INPUT FOR PSOFILE AND DIC
14 N PSVLOOP,PSVTEST,PSVALID S PSVALID=-1
15 F PSVLOOP=1:1 S PSVTEST=$P($T(FILES+PSVLOOP),";;",2)_";;"_$P($T(FILES+PSVLOOP),";;",3) Q:$G(PSVTEST)'>0!(PSVALID=1) D
16 .I PSTFILE=$P(PSVTEST,";;",1) D Q
17 ..I PSTFIELD=$P(PSVTEST,";;",2) S PSVALID=1
18 Q PSVALID
19 ;
20FILES ;ACCESS FILE LIST
21 ;;55.06;;28
22 ;;55.01;;100
23 ;;55.05;;5
24 Q
25CLINIC(PSSORD,PSSDFN,PSSMED) ;
26 ;PSSORD - ORDER NUMBER
27 ;PSSDFN - DFN NUMBER
28 ;PSSMED - MED TYPE: "U" FOR UNIT DOSE, "I" FOR IV
29 N PSSOUT S PSSOUT=""
30 Q:'PSSORD
31 Q:'PSSDFN
32 Q:$G(PSSMED)=""
33 S PSSIEN=PSSORD_","_PSSDFN
34 K ^TMP($J,"TEMP")
35 ;DMS TEST CASES FOR UNIT DOSE: 73,739
36 ;TEST CASES FOR IV: 6,1
37 I PSSMED="U" D
38 .D GETS^DIQ(55.06,PSSIEN,"130","IE","^TMP($J,""TEMP"")")
39 .I $G(^TMP($J,"TEMP",55.06,PSSIEN_",",130,"I"))'="" S PSSOUT=$G(^TMP($J,"TEMP",55.06,PSSIEN_",",130,"I"))_"^"_$G(^TMP($J,"TEMP",55.06,PSSIEN_",",130,"E"))
40 I PSSMED="I" D
41 .D GETS^DIQ(55.01,PSSIEN,"136","IE","^TMP($J,""TEMP"")")
42 .I $G(^TMP($J,"TEMP",55.01,PSSIEN_",",136,"I"))'="" S PSSOUT=$G(^TMP($J,"TEMP",55.01,PSSIEN_",",136,"I"))_"^"_$G(^TMP($J,"TEMP",55.01,PSSIEN_",",136,"E"))
43 K ^TMP($J,"TEMP")
44 Q PSSOUT
45 ;
Note: See TracBrowser for help on using the repository browser.