- ORWDGX ; SLC/KCM - Generic Orders calls for Windows Dialogs [ 08/05/96 8:21 AM ]
- ;;3.0;ORDER ENTRY/RESULTS REPORTING;**243**;Dec 17, 1997;Build 242
- ;
- ACT() N X,RSLT S X=^(0),RSLT=1
- I "DQ"'[$P(X,U,4) S RSLT=0
- S X1=$O(^ORD(100.98,"B","ACTIVITY",0))
- S X2=$O(^ORD(100.98,"B","NURSING",0))
- I "DQ"'[$P(X,U,4) S RSLT=0
- I RSLT,((U_X1_U_X2_U)'[(U_$P(X,U,5)_U)) S RSLT=0
- Q RSLT
- NURS() N X,RSLT S X=^(0),RSLT=1
- I "DQ"'[$P(X,U,4) S RSLT=0
- I RSLT,($P(X,U,5)'=$O(^ORD(100.98,"B","NURSING",0))) S RSLT=0
- Q RSLT
- OITEXT(Y,DLG) ; Return Orderable Item Text given dialog or quick order
- S Y=$P(^ORD(101.41,DLG,0),U,2)
- Q
- LOAD(LST,PAR) ; Load a list of activity orders
- N I,ILST,DLG,NAM,TLST
- D GETLST^XPAR(.TLST,"ALL",PAR)
- S I=0,ILST=0 F S I=$O(TLST(I)) Q:'I D
- . S DLG=$P(TLST(I),U,2),NAM=$P(^ORD(101.41,+DLG,0),U,2)
- . S ILST=ILST+1,LST(ILST)=DLG_U_NAM
- Q
- ;
- N DLGTYP,OIDLG,FTDLG,OITYP,I,IFN
- S DLGTYP=$P(^ORD(101.41,DLG,0),U,4)
- S OIDLG=$O(^ORD(101.41,"B","OR GTX ORDERABLE ITEM",0))
- S FTDLG=$O(^ORD(101.41,"B","OR GTX FREE TEXT OI",0))
- I DLGTYP="D" D
- . S I=0,IFN=0 F S I=$O(^ORD(101.41,DLG,10,I)) S X=^(I,0) D Q:IFN
- . . I $P(X,U,2)=OIDLG S IFN=I,OITYP="O"
- . . I $P(X,U,2)=FTDLG S IFN=I,OITYP="F"
- . S Y="" I $L($G(^ORD(101.41,DLG,10,IFN,7))) X ^(7)
- . I OITYP="O" S Y=$P(^ORD(101.43,+Y,0),U,1)
- Q
- VMDEF(LST) ; Return dialog definition for vitals/measurements
- N ILST S ILST=0
- S LST($$NXT)="~Measurements" D MEASURE
- S LST($$NXT)="~Schedules" D VMSCHED
- Q
- MEASURE ; Get measurements available
- S X="" F S X=$O(^ORD(101.43,"S.V/M",X)) Q:X="" D
- . S I=$O(^ORD(101.43,"S.V/M",X,0)),LST($$NXT)="i"_I_U_X
- S LST($$NXT)="dTPR B/P" ; ** do this with a parameter
- Q
- VMSCHED ; Get vitals/measurements schedules
- K ^TMP($J,"ORWDGX APGMRV")
- D AP^PSS51P1("GMRV",,,,"ORWDGX APGMRV")
- S X="" F S X=$O(^TMP($J,"ORWDGX APGMRV","APGMRV",X)) Q:X="" D
- . S I=$O(^TMP($J,"ORWDGX APGMRV","APGMRV",X,0)),LST($$NXT)="i"_I_U_X
- K ^TMP($J,"ORWDGX APGMRV")
- Q
- NXT() ; Increment index into LST
- S ILST=ILST+1
- Q ILST
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORWDGX 2084 printed Dec 13, 2024@02:35:31 Page 2
- ORWDGX ; SLC/KCM - Generic Orders calls for Windows Dialogs [ 08/05/96 8:21 AM ]
- +1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**243**;Dec 17, 1997;Build 242
- +2 ;
- ACT() NEW X,RSLT
- SET X=^(0)
- SET RSLT=1
- +1 IF "DQ"'[$PIECE(X,U,4)
- SET RSLT=0
- +2 SET X1=$ORDER(^ORD(100.98,"B","ACTIVITY",0))
- +3 SET X2=$ORDER(^ORD(100.98,"B","NURSING",0))
- +4 IF "DQ"'[$PIECE(X,U,4)
- SET RSLT=0
- +5 IF RSLT
- IF ((U_X1_U_X2_U)'[(U_$PIECE(X,U,5)_U))
- SET RSLT=0
- +6 QUIT RSLT
- NURS() NEW X,RSLT
- SET X=^(0)
- SET RSLT=1
- +1 IF "DQ"'[$PIECE(X,U,4)
- SET RSLT=0
- +2 IF RSLT
- IF ($PIECE(X,U,5)'=$ORDER(^ORD(100.98,"B","NURSING",0)))
- SET RSLT=0
- +3 QUIT RSLT
- OITEXT(Y,DLG) ; Return Orderable Item Text given dialog or quick order
- +1 SET Y=$PIECE(^ORD(101.41,DLG,0),U,2)
- +2 QUIT
- LOAD(LST,PAR) ; Load a list of activity orders
- +1 NEW I,ILST,DLG,NAM,TLST
- +2 DO GETLST^XPAR(.TLST,"ALL",PAR)
- +3 SET I=0
- SET ILST=0
- FOR
- SET I=$ORDER(TLST(I))
- if 'I
- QUIT
- Begin DoDot:1
- +4 SET DLG=$PIECE(TLST(I),U,2)
- SET NAM=$PIECE(^ORD(101.41,+DLG,0),U,2)
- +5 SET ILST=ILST+1
- SET LST(ILST)=DLG_U_NAM
- End DoDot:1
- +6 QUIT
- +7 ;
- +8 NEW DLGTYP,OIDLG,FTDLG,OITYP,I,IFN
- +9 SET DLGTYP=$PIECE(^ORD(101.41,DLG,0),U,4)
- +10 SET OIDLG=$ORDER(^ORD(101.41,"B","OR GTX ORDERABLE ITEM",0))
- +11 SET FTDLG=$ORDER(^ORD(101.41,"B","OR GTX FREE TEXT OI",0))
- +12 IF DLGTYP="D"
- Begin DoDot:1
- +13 SET I=0
- SET IFN=0
- FOR
- SET I=$ORDER(^ORD(101.41,DLG,10,I))
- SET X=^(I,0)
- Begin DoDot:2
- +14 IF $PIECE(X,U,2)=OIDLG
- SET IFN=I
- SET OITYP="O"
- +15 IF $PIECE(X,U,2)=FTDLG
- SET IFN=I
- SET OITYP="F"
- End DoDot:2
- if IFN
- QUIT
- +16 SET Y=""
- IF $LENGTH($GET(^ORD(101.41,DLG,10,IFN,7)))
- XECUTE ^(7)
- +17 IF OITYP="O"
- SET Y=$PIECE(^ORD(101.43,+Y,0),U,1)
- End DoDot:1
- +18 QUIT
- VMDEF(LST) ; Return dialog definition for vitals/measurements
- +1 NEW ILST
- SET ILST=0
- +2 SET LST($$NXT)="~Measurements"
- DO MEASURE
- +3 SET LST($$NXT)="~Schedules"
- DO VMSCHED
- +4 QUIT
- MEASURE ; Get measurements available
- +1 SET X=""
- FOR
- SET X=$ORDER(^ORD(101.43,"S.V/M",X))
- if X=""
- QUIT
- Begin DoDot:1
- +2 SET I=$ORDER(^ORD(101.43,"S.V/M",X,0))
- SET LST($$NXT)="i"_I_U_X
- End DoDot:1
- +3 ; ** do this with a parameter
- SET LST($$NXT)="dTPR B/P"
- +4 QUIT
- VMSCHED ; Get vitals/measurements schedules
- +1 KILL ^TMP($JOB,"ORWDGX APGMRV")
- +2 DO AP^PSS51P1("GMRV",,,,"ORWDGX APGMRV")
- +3 SET X=""
- FOR
- SET X=$ORDER(^TMP($JOB,"ORWDGX APGMRV","APGMRV",X))
- if X=""
- QUIT
- Begin DoDot:1
- +4 SET I=$ORDER(^TMP($JOB,"ORWDGX APGMRV","APGMRV",X,0))
- SET LST($$NXT)="i"_I_U_X
- End DoDot:1
- +5 KILL ^TMP($JOB,"ORWDGX APGMRV")
- +6 QUIT
- NXT() ; Increment index into LST
- +1 SET ILST=ILST+1
- +2 QUIT ILST