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

GMPLBLD1.m

Go to the documentation of this file.
  1. GMPLBLD1 ; ISL/MKB,JER - Bld PL Selection Lists cont ;09/22/11 14:40
  1. ;;2.0;Problem List;**3,28,36**;Aug 25, 1994;Build 65
  1. ;
  1. ; This routine invokes IA #3991,#10082
  1. ;
  1. SEL() ; Select item(s) from list
  1. N DIR,X,Y,MAX,GRP S GRP=$D(GMPLGRP) ; =1 if editing groups, 0 if lists
  1. S MAX=$P($G(^TMP("GMPLST",$J,0)),U,1) I MAX'>0 Q "^"
  1. S DIR(0)="LAO^1:"_MAX,DIR("A")="Select "_$S('GRP:"Category",1:"Problem")_"(s)"
  1. S:MAX>1 DIR("A")=DIR("A")_" (1-"_MAX_"): "
  1. S:MAX'>1 DIR("A")=DIR("A")_": ",DIR("B")=1
  1. S DIR("?")="Enter the "_$S('GRP:"categories",1:"problems")_" you wish to select, as a range or list of numbers"
  1. D ^DIR S:$D(DTOUT)!(X="") Y="^"
  1. Q Y
  1. ;
  1. SEL1() ; Select item from list
  1. N DIR,X,Y,MAX,GRP S GRP=$D(GMPLGRP) ; =1 if editing groups, 0 if lists
  1. S MAX=$P($G(^TMP("GMPLST",$J,0)),U,1) I MAX'>0 Q "^"
  1. S DIR(0)="NAO^1:"_MAX_":0",DIR("A")="Select "_$S('GRP:"Category",1:"Problem")
  1. S:MAX>1 DIR("A")=DIR("A")_" (1-"_MAX_"): "
  1. S:MAX'>1 DIR("A")=DIR("A")_": ",DIR("B")=1
  1. S DIR("?")="Enter the "_$S('GRP:"category",1:"problem")_" you wish to select, by number"
  1. D ^DIR I $D(DTOUT)!(X="") S Y="^"
  1. Q Y
  1. ;
  1. SEQ(NUM) ; Enter/edit seq #, returns new #
  1. N DIR,X,Y,GRP S GRP=$D(GMPLGRP) ; =1 if editing groups, 0 if lists
  1. S DIR(0)="NA^.01:999.99:2",DIR("A")="SEQUENCE: " S:NUM DIR("B")=NUM
  1. S DIR("?",1)="Enter a number indicating the sequence of this item in the "_$S('GRP:"list;",1:"category;")
  1. S DIR("?")="up to 2 decimal places may be used, to order these items."
  1. SQ D ^DIR I $D(DTOUT)!(X="^") Q "^"
  1. I X?1"^".E W $C(7),$$NOJUMP G SQ
  1. I Y=NUM Q NUM
  1. I $D(^TMP("GMPLIST",$J,"SEQ",Y)) D G SQ
  1. . W $C(7),!!,"Sequence number already in use! Please enter another number."
  1. . W !,"Use the 'Change View' option to display the current sequence numbers.",!
  1. Q Y
  1. ;
  1. HDR(TEXT) ; Enter/edit group subheader text in list
  1. N DIR,X,Y S:$L(TEXT) DIR("B")=TEXT
  1. S DIR(0)="FAO^2:30",DIR("A")="HEADER: "
  1. S DIR("?")="Enter the text you wish displayed as a header for this category of problems"
  1. S:$D(DIR("B")) DIR("?",1)=DIR("?")_";",DIR("?")="enter '@' if no header text is desired."
  1. H1 D ^DIR I $D(DTOUT)!(X="^") Q "^"
  1. I X?1"^".E W $C(7),$$NOJUMP G H1
  1. I X="@" Q:$$SURE^GMPLX "" G H1
  1. Q Y
  1. ;
  1. TEXT(TEXT) ; Edit problem text
  1. N DIR,X,Y S:$L(TEXT) DIR("B")=TEXT
  1. S DIR(0)="FAO^2:80",DIR("A")=" DISPLAY TEXT: "
  1. S DIR("?")="Enter the text you wish presented here for this problem."
  1. T1 D ^DIR I $D(DTOUT)!("^"[X) S Y="^" G TQ
  1. I X?1"^".E W $C(7),$$NOJUMP G T1
  1. I X="@" G:'$$SURE^GMPLX T1 S Y="@" G TQ
  1. TQ Q Y
  1. ;
  1. CODE(SCTCODE,ICDCODE) ; Confirm problem codes
  1. N DIR,X,Y,CODESYS
  1. S CODESYS="ICD-9-CM"
  1. W !!?2,"The following ",$S(SCTCODE]"":"SNOMED CT & ",1:""),CODESYS," Code(s) are associated with the problem",!?2,"you selected:"
  1. I SCTCODE]"" W !!?2,"SNOMED CT: ",SCTCODE,?24,CODESYS,": ",ICDCODE,!
  1. E W !!?2,CODESYS,": ",ICDCODE,!
  1. S DIR(0)="YA",DIR("A")=" ... Ok? "
  1. S DIR("?")="Please indicate ((Y)es or (N)o) whether the problem/code(s) specified are appropriate."
  1. C1 D ^DIR I $D(DTOUT)!(X="^") S Y="^" G CQ
  1. I X?1"^".E W $C(7),$$NOJUMP G C1
  1. I X="@" G:'$$SURE^GMPLX C1 S Y=""
  1. S:+Y'>0 Y="" S:+Y>0 Y=ICDCODE
  1. W !
  1. CQ Q Y
  1. ;
  1. FLAG(DFLT) ; Edit category flag
  1. N DIR,X,Y S DIR(0)="YAO",DIR("B")=$S(+DFLT:"YES",1:"NO")
  1. S DIR("A")="SHOW PROBLEMS AUTOMATICALLY? "
  1. S DIR("?",1)="Enter YES if you wish the problems contained in this category to be",DIR("?",2)="automatically displayed upon entry to this list; NO will display only the",DIR("?")="category header until the user selects it to view."
  1. F1 D ^DIR I $D(DTOUT)!(X="^") Q "^"
  1. I X?1"^".E W $C(7),$$NOJUMP G F1
  1. Q Y
  1. ;
  1. NOJUMP() ; Message
  1. Q " ^-jumping not allowed!"
  1. ;
  1. RETURN() ; End of page prompt
  1. N DIR,X,Y
  1. S DIR(0)="E" D ^DIR
  1. Q +Y
  1. ;
  1. TMPIFN() ; Get temporary IFN ("#N") for ^TMP("GMPLIST",$J,)
  1. N I,LAST S (I,LAST)=0
  1. F S I=$O(^TMP("GMPLIST",$J,I)) Q:+I'>0 S:I?1.N1"N" LAST=+I
  1. S I=LAST+1,I=$E("0000",1,4-$L(I))_I
  1. TMPQ Q I_"N"
  1. ;
  1. DELETE(IFN) ; Kill entry in ^TMP("GMPLIST",$J,)
  1. N SEQ,ITEM S ^TMP("GMPLIST",$J,0)=^TMP("GMPLIST",$J,0)-1
  1. S SEQ=+^TMP("GMPLIST",$J,IFN),ITEM=$P(^TMP("GMPLIST",$J,IFN),U,2),^TMP("GMPLIST",$J,IFN)="@"
  1. K ^TMP("GMPLIST",$J,"SEQ",SEQ),^TMP("GMPLIST",$J,"PROB",ITEM),^TMP("GMPLIST",$J,"GRP",ITEM)
  1. K:IFN?1.N1"N" ^TMP("GMPLIST",$J,IFN)
  1. Q
  1. ;
  1. RESEQ ; Resequence items
  1. N SEL,NUM,SEQ,NSEQ,PIECE,IFN,GMPQUIT S VALMBCK=""
  1. S SEL=$$SEL G:SEL="^" RSQ
  1. F PIECE=1:1:$L(SEL,",") D Q:$D(GMPQUIT) W !
  1. . S NUM=$P(SEL,",",PIECE) Q:NUM'>0
  1. . S IFN=$P($G(^TMP("GMPLST",$J,"B",NUM)),U,1) Q:+IFN'>0 S SEQ=$P(^TMP("GMPLIST",$J,IFN),U,1)
  1. . W !!,$P(^TMP("GMPLIST",$J,IFN),U,3)
  1. . S NSEQ=$$SEQ(SEQ) I NSEQ="^" S GMPQUIT=1 Q
  1. .I SEQ'=NSEQ S ^TMP("GMPLIST",$J,IFN)=NSEQ_U_$P(^TMP("GMPLIST",$J,IFN),U,2,$L(^TMP("GMPLIST",$J,IFN),U)),^TMP("GMPLIST",$J,"SEQ",NSEQ)=IFN,GMPREBLD=1 K ^TMP("GMPLIST",$J,"SEQ",SEQ)
  1. I $D(GMPREBLD) S VALMBCK="R",GMPLSAVE=1 ; D BUILD in exit action
  1. RSQ S:'VALMCC VALMBCK="R" S VALMSG=$$MSG^GMPLX
  1. Q
  1. ;
  1. EDIT ; Edit category display
  1. N GRPS,NUM,IFN,HDR,FLG,PIECE,GMPQUIT,GMPREBLD S VALMBCK=""
  1. S GRPS=$$SEL G:GRPS="^" EDQ
  1. F PIECE=1:1:$L(GRPS,",") D Q:$D(GMPQUIT) W !
  1. . S NUM=$P(GRPS,",",PIECE) Q:NUM'>0
  1. .S IFN=$P($G(^TMP("GMPLST",$J,"B",NUM)),U,1) Q:+IFN'>0
  1. . S HDR=$P(^TMP("GMPLIST",$J,IFN),U,3),FLG=$P(^TMP("GMPLIST",$J,IFN),U,4)
  1. . S HDR=$$HDR(HDR) I HDR="^" S GMPQUIT=1 Q
  1. . S FLG=$$FLAG(FLG) I FLG="^" S GMPQUIT=1 Q
  1. . S $P(^TMP("GMPLIST",$J,IFN),U,3,4)=HDR_U_FLG,GMPREBLD=1
  1. I $D(GMPREBLD) S VALMBCK="R",GMPLSAVE=1 D BUILD^GMPLBLD("^TMP(""GMPLIST"",$J)",GMPLMODE)
  1. EDQ S:'VALMCC VALMBCK="R" S VALMSG=$$MSG^GMPLX
  1. Q