PXRMUCUM ;SLC/PKR - Utility for UCUM codes. ;04/14/2022
;;2.0;CLINICAL REMINDERS;**65**;Feb 04, 2005;Build 438
;
; API ICR#
;UCUMDATA^LEXMUCUM 6225
;
;===================
UCUMFIELDS(IDEN,FIELDS) ;Given an identifier, which can be an IEN, a
;Description, or a UCUM and a semicolon separated list of fields return
;the fields as a semicolon separated string. Return -1 is the UCUM entry
;does not exist. The fields that can be returned are: COMMENTS, DESCRIPTIION,
;IEN, ROW, UCUM CODE,
N FIELD,FIELDSTRING,IEN,IND,NFIELDS,UCUMDATA
S NFIELDS=$L(FIELDS,";")
I NFIELDS=0 Q 0
D UCUMDATA^LEXMUCUM(IDEN,.UCUMDATA)
S IEN=$O(UCUMDATA(""))
I $D(UCUMDATA(IEN,"ERROR")) Q -1_";"_UCUMDATA(IEN,"ERROR")
S FIELD=$P(FIELDS,";",1)
S FIELDSTRING=UCUMDATA(IEN,FIELD)
F IND=2:1:NFIELDS D
. S FIELD=$P(FIELDS,";",IND)
. S FIELDSTRING=FIELDSTRING_";"_UCUMDATA(IEN,FIELD)
Q FIELDSTRING
;
;===================
UCDHTEXT ;UCUM DISPLAY executable help text.
;;This field specifies how the units are presented when a measurement is
;;displayed in CPRS, Clinical Reminders, and Health Summary. When the value
;;is C, the UCUM Code is displayed when the value is D, the Description is
;;displayed. When the value is N, no units are displayed.
;;**End Text**
Q
;
;===================
UCDXHELP(FILENUM,DA) ;UCUM DISPLAY executable help.
N DONE,DIR0,IND,TEXT,UCUMDATA,UCUMIEN
S DONE=0
F IND=1:1 Q:DONE D
. S TEXT(IND)=$P($T(UCDHTEXT+IND),";",3)
. I TEXT(IND)="**End Text**" S TEXT(IND)=" ",DONE=1 Q
S IND=IND-1
;
;Get the Description and UCUM Code.
S UCUMIEN=$$GET^DDSVAL(FILENUM,DA,223)
I UCUMIEN="" D
. S IND=IND+1,TEXT(IND)="No units have been choosen yet, once they have, the Description and UCUM Code"
. S IND=IND+1,TEXT(IND)="can be displayed to help you decide which to use."
E D
. D UCUMDATA^LEXMUCUM(UCUMIEN,.UCUMDATA)
. S IND=IND+1,TEXT(IND)="The UCUM CODE is: "_UCUMDATA(UCUMIEN,"UCUM CODE")
. S IND=IND+1,TEXT(IND)="The description is: "_UCUMDATA(UCUMIEN,"DESCRIPTION")
;
D BROWSE^DDBR("TEXT","NR","UCUM DISPLAY field Help")
I $D(DDS) D REFRESH^DDSUTL S DY=IOSL-7,DX=0 X IOXY S $Y=DY,$X=DX
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXRMUCUM 2214 printed Oct 16, 2024@17:50:30 Page 2
PXRMUCUM ;SLC/PKR - Utility for UCUM codes. ;04/14/2022
+1 ;;2.0;CLINICAL REMINDERS;**65**;Feb 04, 2005;Build 438
+2 ;
+3 ; API ICR#
+4 ;UCUMDATA^LEXMUCUM 6225
+5 ;
+6 ;===================
UCUMFIELDS(IDEN,FIELDS) ;Given an identifier, which can be an IEN, a
+1 ;Description, or a UCUM and a semicolon separated list of fields return
+2 ;the fields as a semicolon separated string. Return -1 is the UCUM entry
+3 ;does not exist. The fields that can be returned are: COMMENTS, DESCRIPTIION,
+4 ;IEN, ROW, UCUM CODE,
+5 NEW FIELD,FIELDSTRING,IEN,IND,NFIELDS,UCUMDATA
+6 SET NFIELDS=$LENGTH(FIELDS,";")
+7 IF NFIELDS=0
QUIT 0
+8 DO UCUMDATA^LEXMUCUM(IDEN,.UCUMDATA)
+9 SET IEN=$ORDER(UCUMDATA(""))
+10 IF $DATA(UCUMDATA(IEN,"ERROR"))
QUIT -1_";"_UCUMDATA(IEN,"ERROR")
+11 SET FIELD=$PIECE(FIELDS,";",1)
+12 SET FIELDSTRING=UCUMDATA(IEN,FIELD)
+13 FOR IND=2:1:NFIELDS
Begin DoDot:1
+14 SET FIELD=$PIECE(FIELDS,";",IND)
+15 SET FIELDSTRING=FIELDSTRING_";"_UCUMDATA(IEN,FIELD)
End DoDot:1
+16 QUIT FIELDSTRING
+17 ;
+18 ;===================
UCDHTEXT ;UCUM DISPLAY executable help text.
+1 ;;This field specifies how the units are presented when a measurement is
+2 ;;displayed in CPRS, Clinical Reminders, and Health Summary. When the value
+3 ;;is C, the UCUM Code is displayed when the value is D, the Description is
+4 ;;displayed. When the value is N, no units are displayed.
+5 ;;**End Text**
+6 QUIT
+7 ;
+8 ;===================
UCDXHELP(FILENUM,DA) ;UCUM DISPLAY executable help.
+1 NEW DONE,DIR0,IND,TEXT,UCUMDATA,UCUMIEN
+2 SET DONE=0
+3 FOR IND=1:1
if DONE
QUIT
Begin DoDot:1
+4 SET TEXT(IND)=$PIECE($TEXT(UCDHTEXT+IND),";",3)
+5 IF TEXT(IND)="**End Text**"
SET TEXT(IND)=" "
SET DONE=1
QUIT
End DoDot:1
+6 SET IND=IND-1
+7 ;
+8 ;Get the Description and UCUM Code.
+9 SET UCUMIEN=$$GET^DDSVAL(FILENUM,DA,223)
+10 IF UCUMIEN=""
Begin DoDot:1
+11 SET IND=IND+1
SET TEXT(IND)="No units have been choosen yet, once they have, the Description and UCUM Code"
+12 SET IND=IND+1
SET TEXT(IND)="can be displayed to help you decide which to use."
End DoDot:1
+13 IF '$TEST
Begin DoDot:1
+14 DO UCUMDATA^LEXMUCUM(UCUMIEN,.UCUMDATA)
+15 SET IND=IND+1
SET TEXT(IND)="The UCUM CODE is: "_UCUMDATA(UCUMIEN,"UCUM CODE")
+16 SET IND=IND+1
SET TEXT(IND)="The description is: "_UCUMDATA(UCUMIEN,"DESCRIPTION")
End DoDot:1
+17 ;
+18 DO BROWSE^DDBR("TEXT","NR","UCUM DISPLAY field Help")
+19 IF $DATA(DDS)
DO REFRESH^DDSUTL
SET DY=IOSL-7
SET DX=0
XECUTE IOXY
SET $Y=DY
SET $X=DX
+20 QUIT
+21 ;