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

PXRMEXU0.m

Go to the documentation of this file.
  1. PXRMEXU0 ;SLC/PKR - Reminder exchange general utilities, #0. ;04/14/2015
  1. ;;2.0;CLINICAL REMINDERS;**4,12,18,26,47**;Feb 04, 2005;Build 291
  1. ;====================================
  1. CFOKTI(IEN,START,STOP) ;Check a computed finding to see if it can be
  1. ;installed. Called from IOKTI^PXRMEXFI.
  1. N INDICES,LN,OK,TEMP
  1. S OK=1
  1. F LN=STOP:-1:START D
  1. . S TEMP=^PXD(811.8,IEN,100,LN,0)
  1. . S INDICES=$P(TEMP,"~",1)
  1. . I $P(INDICES,";",1)'=811.4 Q
  1. .;Check for the Class field, if the value is NATIONAL then set OK=0.
  1. . I ($P(INDICES,";",3)=100) S LN=START,OK=$S($P(TEMP,"~",2)="NATIONAL":0,1:1)
  1. Q OK
  1. ;
  1. ;====================================
  1. LOC(FDA) ;Process the FDA for location lists.
  1. ;Direct reads of ^DIC(40.7) covered by DBIA #537.
  1. N AMIS,IEN,IENS,SFN,STOP,TEMP,TEXT
  1. ;Stop Codes may not have a unique name, use the AMIS Reporting Stop
  1. ;code to determine which one to use.
  1. F SFN=810.9001,810.90011 D
  1. . S IENS=""
  1. . F S IENS=$O(FDA(SFN,IENS)) Q:IENS="" D
  1. .. S STOP=FDA(SFN,IENS,.01)
  1. .. S AMIS=FDA(SFN,IENS,.02)
  1. .. S IEN=$O(^DIC(40.7,"C",AMIS,""))
  1. .. S TEMP=$P(^DIC(40.7,IEN,0),U,1)
  1. .. I TEMP'=STOP D Q
  1. ... S TEXT(1)="Name associated with AMIS stop code does not match the one in the"
  1. ... S TEXT(2)="packed reminder:"
  1. ... S TEXT(3)=" AMIS="_AMIS
  1. ... S TEXT(4)=" Site Name="_TEMP
  1. ... S TEXT(5)=" Name in packed reminder="_STOP
  1. ... D EN^DDIOL(.TEXT)
  1. .. S FDA(SFN,IENS,.01)="`"_IEN
  1. Q
  1. ;
  1. ;====================================
  1. GETIEN(NFOUND,LIST) ;FIND^DIC has found multiple entries with the same name.
  1. ;NFOUND is the number found, LIST is the array returned by FIND^DIC.
  1. ;Ask the user which one they want to use.
  1. N DIR,FN,IND,NC,X,Y
  1. S DIR(0)="S^"
  1. F IND=1:1:NFOUND D
  1. . S DIR(0)=DIR(0)_IND_":"_LIST("DILIST",2,IND)_";"
  1. S DIR("L",1)="Select one of the following to use:"
  1. S NC=1
  1. F IND=1:1:NFOUND D
  1. . S NC=NC+1
  1. . S DIR("L",NC)=IND_"- "_LIST("DILIST",1,IND)_" IEN="_LIST("DILIST",2,IND)
  1. . S FN=$O(LIST("DILIST","ID",IND,""))
  1. . I FN="" Q
  1. . S NC=NC+1
  1. . S DIR("L",NC)=" "_LIST("DILIST","ID",IND,FN)
  1. . F S FN=$O(LIST("DILIST","ID",IND,FN)) Q:FN="" D
  1. .. I $L(LIST("DILIST","ID",IND,FN))=0 Q
  1. .. S NC=NC+1
  1. .. S DIR("L",NC)=" "_LIST("DILIST","ID",IND,FN)
  1. ;Truncate DIR("L") as required.
  1. S DIR("L")=DIR("L",NC) K DIR("L",NC)
  1. D ^DIR
  1. I Y="^" D
  1. . N TEXT
  1. . S TEXT(1)="Entering ""^"" tells Reminder Exchange the entry does not exist. You will be"
  1. . S TEXT(2)="ask for a replacement."
  1. . D EN^DDIOL(.TEXT)
  1. Q $S($D(Y(0)):Y(0),1:0)
  1. ;
  1. ;====================================
  1. ISPCEFIL(FILENUM) ;Return true if FILENUM is a PCE file.
  1. I FILENUM=9999999.09 Q 1 ;EDUCATION TOPICS
  1. I FILENUM=9999999.15 Q 1 ;EXAM
  1. I FILENUM=9999999.64 Q 1 ;HEALTH FACTORS
  1. I FILENUM=9999999.14 Q 1 ;IMMUNIZATION
  1. I FILENUM=9999999.28 Q 1 ;SKIN TEST
  1. I FILENUM=9999999.17 Q 1 ;TREATMENT
  1. Q 0
  1. ;
  1. ;====================================
  1. SFNFTC(IEN) ;Set the found/not found text line counts in the reminder
  1. ;definition.
  1. D SNMLA^PXRMFNFT(IEN)
  1. D SNMLF^PXRMFNFT(IEN,20)
  1. D SNMLF^PXRMFNFT(IEN,25)
  1. D SNMLL^PXRMFNFT(IEN)
  1. Q
  1. ;
  1. ;====================================
  1. TAX(FDA,NODE) ;Process the FDA for taxonomies. This is for the conversion from
  1. ;the pointer based structure to Lexicon based structure.
  1. N CODE,CODEIEN,HIGH,IENS,LABEL,LOW,MSG
  1. K ^TMP($J,NODE)
  1. ;Brief Description
  1. S IENS=$O(FDA(811.2,""))
  1. I $D(FDA(811.2,IENS,.02)) S ^TMP($J,NODE,"BDES")=FDA(811.2,IENS,.02)
  1. ;
  1. ;ICD codes.
  1. S IENS=""
  1. F S IENS=$O(FDA(811.22102,IENS)) Q:IENS="" D
  1. . S LOW=FDA(811.22102,IENS,.01)
  1. . S HIGH=$G(FDA(811.22102,IENS,1))
  1. . I HIGH="" S HIGH=LOW
  1. . S ^TMP($J,NODE,"ICD",LOW,HIGH)=""
  1. ;
  1. ;ICP codes.
  1. S IENS=""
  1. F S IENS=$O(FDA(811.22103,IENS)) Q:IENS="" D
  1. . S LOW=FDA(811.22103,IENS,.01)
  1. . S HIGH=$G(FDA(811.22103,IENS,1))
  1. . I HIGH="" S HIGH=LOW
  1. . S ^TMP($J,NODE,"ICP",LOW,HIGH)=""
  1. ;
  1. ;CPT codes.
  1. S IENS=""
  1. F S IENS=$O(FDA(811.22104,IENS)) Q:IENS="" D
  1. . S LOW=FDA(811.22104,IENS,.01)
  1. . S HIGH=$G(FDA(811.22104,IENS,1))
  1. . I HIGH="" S HIGH=LOW
  1. . S ^TMP($J,NODE,"CPT",LOW,HIGH)=""
  1. ;
  1. ;Selectable ICD codes.
  1. S IENS=""
  1. F S IENS=$O(FDA(811.23102,IENS)) Q:IENS="" D
  1. . S CODE=FDA(811.23102,IENS,.01)
  1. . S CODE=$TR(CODE," ","")
  1. . S ^TMP($J,NODE,"SDX",CODE)=""
  1. . S CODEIEN=+$$EXISTS^PXRMEXIU(80,CODE,"BX")
  1. . I CODEIEN>0 S FDA(811.23102,IENS,.01)="`"_CODEIEN
  1. ;
  1. ;Selectable CPT codes.
  1. S IENS=""
  1. F S IENS=$O(FDA(811.23104,IENS)) Q:IENS="" D
  1. . S CODE=FDA(811.23104,IENS,.01)
  1. . S CODE=$TR(CODE," ","")
  1. . S FDA(811.23104,IENS,.01)=CODE
  1. . S ^TMP($J,NODE,"SPR",CODE)=""
  1. ;
  1. ;If these fields no longer exist in the DD remove them from the FDA.
  1. ;Brief Description
  1. S LABEL=$$GET1^DIQ(811.2,.02,"","LABEL","","MSG")
  1. I LABEL="" S IENS=$O(FDA(811.2,"")) K FDA(811.2,IENS,.02)
  1. ;
  1. ;Dialog Header Text
  1. S LABEL=$$GET1^DIQ(811.2,.03,"","LABEL","","MSG")
  1. I LABEL="" K FDA(811.2,IENS,.03)
  1. ;
  1. ;ICD9 range of codes.
  1. S LABEL=$$GET1^DIQ(811.2,2102,"","LABEL","","MSG")
  1. I LABEL="" K FDA(811.22102)
  1. ;
  1. ;ICD0 range of codes.
  1. S LABEL=$$GET1^DID(811.2,2103,"","LABEL","","MSG")
  1. I LABEL="" K FDA(811.22103)
  1. ;
  1. ;CPT range of codes.
  1. S LABEL=$$GET1^DID(811.2,2104,"","LABEL","","MSG")
  1. I LABEL="" K FDA(811.22104)
  1. ;
  1. ;Selectable diagnosis.
  1. S LABEL=$$GET1^DID(811.2,3102,"","LABEL","","MSG")
  1. I LABEL="" K FDA(811.23102)
  1. ;
  1. ;Selectable procedure.
  1. S LABEL=$$GET1^DID(811.2,3104,"","LABEL","","MSG")
  1. I LABEL="" K FDA(811.23104)
  1. ;
  1. ;Generate dialog dx parameter
  1. S LABEL=$$GET1^DIQ(811.2,3106,"","LABEL","","MSG")
  1. I LABEL="" K FDA(811.2,IENS,3106)
  1. ;
  1. ;Current visit dx dialog hdr
  1. S LABEL=$$GET1^DIQ(811.2,3107,"","LABEL","","MSG")
  1. I LABEL="" K FDA(811.2,IENS,3107)
  1. ;
  1. ;Visit dx dialog hdr
  1. S LABEL=$$GET1^DIQ(811.2,3108,"","LABEL","","MSG")
  1. I LABEL="" K FDA(811.2,IENS,3108)
  1. ;
  1. ;Generate dialog pr parameter
  1. S LABEL=$$GET1^DIQ(811.2,3110,"","LABEL","","MSG")
  1. I LABEL="" K FDA(811.2,IENS,3110)
  1. ;
  1. ;Current visit pr dialog hdr
  1. S LABEL=$$GET1^DIQ(811.2,3111,"","LABEL","","MSG")
  1. I LABEL="" K FDA(811.2,IENS,3111)
  1. ;
  1. ;Historical visit pr dialog hdr
  1. S LABEL=$$GET1^DIQ(811.2,3112,"","LABEL","","MSG")
  1. I LABEL="" K FDA(811.2,IENS,3112)
  1. ;
  1. ;If 811.24 is present remove it so it does not get deleted and
  1. ;rebuilt when the "AUID" index is built.
  1. K FDA(811.24)
  1. Q
  1. ;