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

ORWPCE5.m

Go to the documentation of this file.
ORWPCE5 ;SLC/JM - Wrap calls to PCE and Lexicon ;Jul 14, 2021@12:19:12
 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**405**;Dec 17, 1997;Build 211
 Q
 ;
UCUMLIST(Y,FROM,DIR) ; Long List for UCUM lookup - IA #6224
 ; .Y=returned list, FROM=text to $O from, DIR=$O direction
 N I,DA,CNT,TIUD0,N0,N1
 S I=0,CNT=80,DIR=$G(DIR,1)
 F  Q:I'<CNT  S FROM=$O(^LEX(757.5,"UPB",FROM),DIR) Q:FROM=""  D
 . S DA=0
 . F  Q:I'<CNT  S DA=$O(^LEX(757.5,"UPB",FROM,DA)) Q:+DA'>0  D
 . . S N0=$G(^LEX(757.5,DA,0)) S N1=$G(^LEX(757.5,DA,1))
 . . S I=I+1,Y(I)=DA_U_N0_U_$P(N1,U,1)
 Q
 ;
REMTAX(Y) ; Returns a list of reminder taxonomies with standard codes
 N TAXLIST,IDX,IEN,CODES,I
 D TAXLIST^PXRMTAXI(.TAXLIST)
 S IDX="",I=0
 F  S IDX=$O(TAXLIST(IDX)) Q:IDX=""  D
 . S IEN=TAXLIST(IDX)
 . K CODES D CODELIST^PXRMTAXI(IEN,1,.CODES)
 . I $O(CODES("SCT",""))'="" S I=I+1,Y(I)=IEN_U_IDX
 Q
 ;
REPLCODE(RESULT,ENCDATE,CODESYS,CODE) ;
 N CNT,CODELIST,TEMP
 D UIDSEARCH^PXRMTXCS(CODESYS,CODE,ENCDATE,.CODELIST)
 S TEMP="",CNT=0 F  S TEMP=$O(CODELIST(TEMP)) Q:TEMP=""  D
 .I TEMP=CODE Q
 .S CNT=CNT+1,RESULT(CNT)=TEMP_CODELIST(TEMP)
 Q
 ;
TAXCODES(Y,TAXONOMY,DATE) ; Returns a list of standard codes within a taxonomy
 N CODE,CODES,SYSTEM,SYSIEN,INFO,DESC
 I $D(DATE)=0 S DATE=DT
 D CODELIST^PXRMTAXI(TAXONOMY,1,.CODES)
 S SYSTEM="SCT"
 S SYSIEN=$P($$CSYS^LEXU(SYSTEM),U,1)
 S CODE=0 F  S CODE=$O(CODES(SYSTEM,CODE)) Q:CODE=""  D
 . S INFO=$$EXP^LEXCODE(CODE,SYSIEN,DATE) Q:+INFO<0
 . S DESC=$P($G(INFO),U,2)
 . I DESC'="" S Y(DESC)=SYSTEM_U_CODE_U_DESC
 Q
 ;
NOTEDATE(Y,NOTEIEN) ; Returns note reference date for use as secondary visit date
 D NOTEINFO(.Y,NOTEIEN,13,1)
 Q
NOTELOC(Y,NOTEIEN) ; Returns the note location
 D NOTEINFO(.Y,NOTEIEN,12,5)
 Q
NOTEINFO(Y,NOTEIEN,NODE,PIECE) ; Returns note data
 N IEN
 I $$ISADDNDM^TIULC1(NOTEIEN) S IEN=$P($G(^TIU(8925,NOTEIEN,0)),U,6)
 E  S IEN=NOTEIEN
 S Y=$P($G(^TIU(8925,IEN,NODE)),U,PIECE)
 Q
 ;
MAGDAT(ORY,TYPE,CODE) ; Get Magnitute and UCUM code settings for a specific code
 N FILE,IDX,IEN,N1,MAGCOMPLETE,PIECES
 S ORY=""
 S FILE=$S(TYPE="PED":9999999.09,TYPE="XAM":9999999.15,TYPE="HF":9999999.64,TYPE="SC":811.2,1:0) I 'FILE Q
 S ORY=$S(FILE=811.2:$$GMPARAMS^PXRMDTAX(CODE),1:$$GMPARAMS^PXAPI(FILE,CODE))
 S MAGCOMPLETE=1
 S PIECES=$L(ORY,U)
 F IDX=1:1:PIECES I $P(ORY,U,IDX)="" S MAGCOMPLETE=0
 I 'MAGCOMPLETE S ORY="" Q
 S IEN=$P(ORY,U,4) I IEN D
 . S ORY=ORY_U_$G(^LEX(757.5,IEN,0))
 . S N1=$S($P(ORY,U,6)="C":$P($G(^LEX(757.5,IEN,1)),U,1),$P(ORY,U,6)="N":"",1:$P($G(^LEX(757.5,IEN,0)),U))
 . ;I "^(^{^[^"'[(U_$E(N1)_U) S N1="("_N1_")"
 . ;I N1'="" S $P(ORY,U,6)=N1
 . S $P(ORY,U,6)=N1
 Q
 ;