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

ORQOCONV1.m

Go to the documentation of this file.
  1. ORQOCONV1 ; SLC/AGP - Utility report for Order Dialogs cont;Dec 08, 2021@10:44:36
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**405**;DEC 17, 1997;Build 211
  1. ;
  1. ; DBIA 5133: reading ^PXRMD file #801.41
  1. Q
  1. ;
  1. REPORT(REPSUB,REPTYPE,ARRAY) ;
  1. N CNT,DISABLE,IDX,IEN,ISCOM,NAME,NL,NODE,NOUT,ONMENU,OUTPUT,ORDIALOG,PROMPT,PROMPTS
  1. N QOIEN,SPINCNT,TCNT,TIDX,TMP,TEXT,TEXTOUT,VALUE,X
  1. K ^TMP($J,"ORQOCONV REPORT OUTPUT")
  1. S CNT=0,SPINCNT=0
  1. I REPTYPE="F" D
  1. .D SPIN^ORQOUTL("Building Report output",.SPINCNT)
  1. .S CNT=CNT+1,^TMP($J,"ORQOCONV REPORT OUTPUT",CNT)=$$LJ^XLFSTR("Name",40)_$$LJ^XLFSTR("Disable",10)_$$LJ^XLFSTR("Attached",10)
  1. .S CNT=CNT+1,^TMP($J,"ORQOCONV REPORT OUTPUT",CNT)=$$REPEAT^XLFSTR("-",79)
  1. .S PROMPT="" F S PROMPT=$O(ARRAY("HASVALUE",PROMPT)) Q:PROMPT="" D
  1. ..S PROMPTS(PROMPT)=""
  1. .S PROMPT="" F S PROMPT=$O(ARRAY("NOVALUE",PROMPT)) Q:PROMPT="" D
  1. ..S PROMPTS(PROMPT)=""
  1. S QOIEN=0 F S QOIEN=$O(^TMP($J,REPSUB,QOIEN)) Q:QOIEN'>0 D
  1. .I REPTYPE="F" D SPIN^ORQOUTL("Building Report output",.SPINCNT)
  1. .S ONMENU=$S(^TMP($J,REPSUB,QOIEN)=1:"Yes",1:"No")
  1. .S NODE=$G(^ORD(101.41,QOIEN,0))
  1. .S NAME=$P(NODE,U)
  1. .S DISABLE=$S($P(NODE,U,3)'="":"Yes",1:"No")
  1. .I REPTYPE="A" D SHOW^ORQOCONV(QOIEN) W !! Q
  1. .I CNT>2 S CNT=CNT+1,^TMP($J,"ORQOCONV REPORT OUTPUT",CNT)=""
  1. .K ORDIALOG
  1. .D GETQDLG^ORCD(QOIEN)
  1. .S CNT=CNT+1,^TMP($J,"ORQOCONV REPORT OUTPUT",CNT)=$$LJ^XLFSTR(NAME,40)_$$LJ^XLFSTR(DISABLE,10)_$$LJ^XLFSTR("Attached",10)
  1. .S PROMPT="" F S PROMPT=$O(PROMPTS(PROMPT)) Q:PROMPT="" D
  1. ..S NODE=$G(ORDIALOG("B",PROMPT))
  1. ..S IEN=+$P(NODE,U,2)
  1. ..I +$O(ORDIALOG(IEN,"?"),-1)=0 S CNT=CNT+1,^TMP($J,"ORQOCONV REPORT OUTPUT",CNT)=$$RJ^XLFSTR(PROMPT,30) Q
  1. ..S TCNT=0
  1. ..S IDX=0 F S IDX=$O(ORDIALOG(IEN,IDX)) Q:IDX'>0 D
  1. ...K ISCOM,NOUT,TEXT,TEXTOUT,VALUE,X
  1. ...S VALUE=$G(ORDIALOG(IEN,IDX))
  1. ...S ISCOM=$S(VALUE["^TMP(":1,1:0)
  1. ...I ISCOM S TIDX=0 F S TIDX=$O(@VALUE@(TIDX)) Q:TIDX'>0 D
  1. ....S TCNT=TCNT+1,TEXT(TCNT)=@VALUE@(TIDX,0)
  1. ...I 'ISCOM S TCNT=TCNT+1,TEXT(TCNT)=$$RJ^XLFSTR(PROMPT,30)_$J(" ",5)_VALUE Q
  1. ...I $D(TEXT) D Q
  1. ....D FORMAT^PXRMTEXT(1,40,.TCNT,.TEXT,.NOUT,.TEXTOUT)
  1. ....F X=1:1:NOUT D
  1. .....I X=1 S CNT=CNT+1,^TMP($J,"ORQOCONV REPORT OUTPUT",CNT)=$$RJ^XLFSTR(PROMPT,30)_$J(" ",5)_TEXTOUT(X) Q
  1. .....S CNT=CNT+1,^TMP($J,"ORQOCONV REPORT OUTPUT",CNT)=$J(" ",35)_TEXTOUT(X)
  1. ...S CNT=CNT+1,^TMP($J,"ORQOCONV REPORT OUTPUT",CNT)=$$RJ^XLFSTR(PROMPT,30)
  1. S IDX=0 F S IDX=$O(^TMP($J,"ORQOCONV REPORT OUTPUT",IDX)) Q:IDX'>0 D
  1. .W !,^TMP($J,"ORQOCONV REPORT OUTPUT",IDX)
  1. K ^TMP($J,"ORQOCONV REPORT OUTPUT")
  1. Q