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