Robert Cemper · Apr 11, 2018 go to post

Typically a Message in Ensemble is inheriting from Ens.Request
e.g.  Class EnsLib.Testing.Request Extends Ens.Request

I have no Healthshare at hands to identify your correct message
just to confirm 
Enslib.HL7.Message does NOT extend Ens.Request as it is a  Persistent object on it's own.

Robert Cemper · Apr 11, 2018 go to post

Your message might be locked by some other process at that time. 
Try to raise your Lock level to have exclusive access to your persistent object  %GetLock(id) which you need during %Save()
 If it fails you should find out who else is locking it. 

Robert Cemper · Apr 9, 2018 go to post

That's mine:

ClassMethod main(As %Integer = 10)
r=1:1:! c=1:1:$s(c=1!(r=1)!(r=s)!(c=s)!(c=r)!(s-r+1=c):"#",1:" ")}
Robert Cemper · Apr 9, 2018 go to post

Check if Output Frame is open.
IF it resists to appear.

  • goto fullscreen mode
  • click to View / Output  (ALT+2)

If still invisible:

  • move the mouse pointer slowly up from the down border to catch the top border of the output frame
  • pull it up to make is visible.

Robert Cemper · Apr 9, 2018 go to post
  • select target namespace (e.g. SAMPLES)
  • Find in files 
  • Find What:   (e.g. person)
  • file type (e.g. *.cls )
  • uncheck all boxes
  • forget all filters
  • eventually check  Search in System Items
  • (Match case is a source of surprises )
  • (Match whole word only is fair chance to see nothing)
  • FIND and be patient to see the full result

Robert Cemper · Apr 7, 2018 go to post

In Caché classes the general rule is to remove underscores for internal use.

For Properties you have the parameter SqlFieldName to keep the original name and also use it for SQL access. (e.g. INSERT)
 

Property AccessionDate As %Date [ SqlFieldName = ACCESSION_DATE ];
Robert Cemper · Apr 7, 2018 go to post

"  I found a utility in CACHE "   which one ?

most likely you might pass column names as string parameters "ACCESSION_DATE"

Robert Cemper · Apr 5, 2018 go to post

Sorry to be late. I was busy today:

Thanks to  @Eduard Lebedyuk

I did it in a traditional one-liner: 79  77 char.   + 4 char extra to read the size.
I'll wrap it into a method later to see how much waste of space this generates. devil

5 min. later:
OK. Method consumes 3 char. extra {} to enclose it + blank at the start   =>>> 82   80  ~3.9% overhead

s=1...4 looks odd but it improves.

f j=1:1:15 zw j d ##class(DC.size).main(j) 
j=1
#
j=2
##
##
j=3
###
###
###
j=4
####
####
####
####
j=5
#####
## ##
# # #
## ##
#####
j=6
######
##  ##
# ## #
# ## #
##  ##
######
j=7
#######
##   ##
# # # #
#  #  #
# # # #
##   ##
#######
j=8
########
##    ##
# #  # #
#  ##  #
#  ##  #
# #  # #
##    ##
########
Robert Cemper · Mar 31, 2018 go to post

Evgeny,

My SAMPLES has no listing 'Custom Listing' in HoleFoods

But this works:

SAMPLES>d $SYSTEM.DeepSee.Shell()
DeepSee Command Line Shell
----------------------------------------------------
Enter q to quit, ? for help. 
>>DRILLTHROUGH SELECT FROM [HoleFoods] %LISTING [Customer Info]
 
   #  ID        Store Loc Country   Product   Customer  Latitude  Longitude
   1: 1         Tokyo     Japan    
Free-rang
   2: 2         Shanghai  China     Lifesaver
   3: 3         Sao Paolo Brasil    Onion rin
   4: 4         Paris     France    Ziti (box
   5: 5         Santiago  Chile     Donuts (d
   6: 6         Brasilia  Brasil    Ziti (box
   7: 7         Madrid    Spain     Donuts (d
   8: 8         Chicago   USA      
Tortellin 46168     39.716036 -86.39506
   9: 9         Frankfurt Germany   Swiss Che
  10: 10        Tokyo     Japan     Onion rin

similar:

 >>DRILLTHROUGH SELECT FROM [Patients] %LISTING [Custom SQL listing]
 
   #  PatientID      FavoriteColor
   1: SUBJ_100301    Green
   2: SUBJ_100302    Orange
   3: SUBJ_100303    Yellow
   4: SUBJ_100305    Orange
   5: SUBJ_100306    Purple
   6: SUBJ_100307    Orange
   7: SUBJ_100308    Blue
Robert Cemper · Mar 31, 2018 go to post

There is no default %PCL.int as mnemonics for PCL printing in Caché.
So according to the link

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GIOD_intro#GIOD_intro_definemnemomic

you have to write it yourself.

But before this interesting exercise find a document on the control codes for your "low-end HP laser printer and a Brother laser"

Your description is just to vague to google for it. you depend on the type an level of PCL.
I tried and got 2.46 million hits on bold printing for Brother Laser.
This one looked useful but I didn't read all 531 pages and I don't know your printer version.
https://www.brother.com.au/pdf/support/controlcodes/PCL_Tech_Manual.pdf

This looked most useful:

5.2.11. Selecting the stroke weight
Esc(s#B (27)(40)(115)#(66) <1Bh><28h><73h>#<42h>
 This command designates the stroke weight of the primary font.
Esc)s#B (27)(41)(115)#(66) <1Bh><29h><73h>#<42h>
 This command designates the stroke weight of the secondary font
 # is an integer between –7 and 7. A value of 0 signifies a medium stroke weight, negative numbers signify
thin or light stroke weights and positive numbers signify bold stroke weights.
 If you select a light or bold stroke weight the command will only have an effect if the font is available in one of the three font locations.

that means you should try first if your printer is covered:

set bold1on=$c(27,40,115)_7_$c(66)
set bold2on=$c(27,41,115)_7_$c(66)
set bold1off=$c(27,40,115)_0_$c(66)
set bold2off=$c(27,41,115)_0_$c(66)
;; let's test it

open prt use prt  write #
     
write !,"test1 " , bold1on, "text with bold1on ", bold1off, "text with bold1off",!
     write !,"test2 " , bold2on, "text with bold2on ", bold2off, "text with bold12off",!

write # close prt

from the description, it is not clear if 7 and 0 are characters or if this are binaries.
you may need to replace it with $c(7) and $c(0). 
once you know the codes you may decide how to make use of it. 
 

Robert Cemper · Mar 21, 2018 go to post

ok

• property Identifier as %String [ Calculated,Transient,ReadOnly ];
http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=ENSLIB&CLASSNAME=EnsLib.HL7.Message#PROPERTY_Identifier

Unique document identification string found at MSH:10 / MessageControlId in document content

You can't set it. It gets calculated and is ReadOnly.

Following http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=ENSLIB&CLASSNAME=EnsLib.HL7.Message
you should probably start  with

     set Set HL7Msg=##class(EnsLib.HL7.Message).%New()
 and start to compose the message accordingly.

Robert Cemper · Mar 20, 2018 go to post

OPEN and USE do not consume an additional  license / license slot

Out of a running job you consume an additional license slot only by a JOB command.

Robert Cemper · Mar 19, 2018 go to post

If you didn't correct the other 2 mistakes it's no surprise.

The code should look like this:

 set tSC=$$$OK
 set ^tvalue=1
 set ^tvalue=$INCREMENT(^tvalue)
 
    #dim rs as EnsLib.SQL.GatewayResultSet
    #dim reStream as %Stream.GlobalCharacter
    if $$$ISERR(pRequest) quit pRequest
    set sc=..Adapter.ExecuteQuery(.rs,..GetTheSubmissionData(pRequest.pMonth, pRequest.pApp, pRequest.pRef, pRequest.pInPat))
   
    if $$$ISERR(sc) quit sc
  
   
set reStream=##class(%Stream.GlobalCharacter).%New()
    while rs.Next() {
        set (comma,rec)=""
        for i=1:1:rs.GetColumnCount() {
            set rec=rec_comma_""""_rs.GetData(i)_""""
            set comma=","   
        }
     ;;   set reStream=""   ;; dont kill your stream before using !!! OMG
        set sc=reStream.WriteLine(rec)
        
    }
    do reStream.%Save()

     ;; sc doesn't reflect if there is a content in reStream. check Size instead
   set sc=''reStream.Size

       
       if ($$$ISOK(sc))set pResponse.pReqDetails=reStream
           set reStream=""
        
else {$$$TRACE("There is nothing on the stream")
    
     set tSC=pResponse.%Save()
      
 set tSC=..SendRequestSync(..TargetConfigNames,pResponse,.pOutput)
 Quit tSC

 
Robert Cemper · Mar 16, 2018 go to post

I just can detect.

#dim reStream as %Stream.GlobalCharacter

in your code but nowhere

   set reStream=##class(%Stream.GlobalCharacter).%New()
 

or similar. So no Object.

Robert Cemper · Mar 16, 2018 go to post

Checking some hints for  SMTP.office365.com
https://answers.microsoft.com/en-us/msoffice/forum/msoffice_o365admin-mso_dep365/smtpoffice365com-relay-535-573-authentication/9de8d176-1c07-4e66-b14f-148d3bd51bbf

I see that the require SSL/TLS encryption.

In your code I miss
     Set server.SSLConfiguration = "whatever you named it

This might most likely cause the problem.
 

In anticipation of your next post:  How to setup SSL/TLS configuration.
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCAS_ssltls#GCAS_ssltls_createedit
 

Robert Cemper · Mar 16, 2018 go to post

It's indeed incredible simple. You just have to bend your fingers a little bit.
And virtual namespace %ALL allows even to have your own "SYSLIB" like behavior with common code.

Robert Cemper · Mar 15, 2018 go to post

resolving the dependencies in the correct order.

That's probably the weakest spot and requires often manual intervention.

Robert Cemper · Mar 15, 2018 go to post

If DATA and CODE are separated then taking over CACHE.DAT from a final test environment could be an option.

But as the default for a namespace is DATA+CODE  and this is widely spread also in large applications in
real environments recompiling is the only possibility. Many years back even a special change was implemented in
Caché to support compiling during runtime of the code.
I personally dislike both and fought for clear separation of CODE from DATA. With very limited success.sad

Robert Cemper · Mar 13, 2018 go to post

I Googled just a few notes:
GE Healthcare to Acquire IDX Systems Corporation  (2005)
https://www.businesswire.com/news/home/20050929005340/en/GE-Healthcare-Acquire-IDX-Systems-Corporation-Significantly

and  wiki tells me it runs on Caché:
https://en.wikipedia.org/wiki/IDX_Systems

But this doesn't tell us how it communicates with users and external devices.
Caché is definitely not blocking a move to Linux. 
C++ based connections may prevent it if you don't have the sources and a lot of experience to test and debug it.
Eventually, other members of the developers' society have more detailed insight.

But I think GE should know it.

Robert Cemper · Mar 13, 2018 go to post

you code is missing the final  Quit result
to satisfy the

     Set tSC=..CheckRequests(.pRequest,.pResponse)

so you return nothing  or the code you showed to us is incomplete

I also miss the closing  }  of WHILE  in your snippet.

If you have no return value write instead 
    DO ..CheckRequests(.pRequest,.pResponse)

Robert Cemper · Mar 13, 2018 go to post

What about a helper classmethod if the expected result is a string

Classmethod DumpHelper(call as %String ) {

   write @call,!

  quit

Robert Cemper · Mar 12, 2018 go to post

do you look for $System.Util.CreateGUID() ?
http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25SYSTEM.Util#METHOD_CreateGUID

Property myguid As %GUID Required ];

Will not work as %Lbrary.GUID is an abstract utility class and does not extend %DataType.  So it is no DataType and has no Accessors!
http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25Library.GUID

use instead.:

Property myguid As  %String  [Required];

and

S obj.myguid = $System. Util.CreateGUID()

But you are free to define your own data type combining %String and %GUID

Robert Cemper · Mar 9, 2018 go to post

there is an external config file in %cacheroot%/cache.cpf 
that holds your configuration. It is loaded at startup.
You can verify it with any text editor and check especially directories. of your DBs
And you see also NAMESPACE definitions.

The important part is at the beginning.

[ConfigFile]
Version=2017.226
[Databases]
CACHESYS=C:\InterSystems\17E20\mgr\
CACHELIB=C:\InterSystems\17E20\mgr\cachelib\
CACHETEMP=C:\InterSystems\17E20\mgr\cachetemp\
CACHE=C:\InterSystems\17E20\mgr\cache\
CACHEAUDIT=C:\InterSystems\17E20\mgr\cacheaudit\
BLOCKS=C:\opt\blocks\data\
DOCBOOK=C:\InterSystems\17E20\mgr\docbook\
ENSDEMO=C:\InterSystems\17E20\mgr\ensdemo\
ENSEMBLE=C:\InterSystems\17E20\mgr\ensemble\
ENSEMBLEENSTEMP=C:\InterSystems\17E20\mgr\ensemble\ensembleenstemp\
ENSEMBLESECONDARY=C:\InterSystems\17E20\mgr\ensemble\ensemblesecondary\
ENSLIB=C:\InterSystems\17E20\mgr\enslib\
SAMPLES=C:\InterSystems\17E20\mgr\samples\
TEST=C:\opt\blocks\test\
USER=C:\InterSystems\17E20\mgr\user\
[Namespaces]
%SYS=CACHESYS
BLOCKS=BLOCKS
DOCBOOK=DOCBOOK
ENSDEMO=ENSDEMO
ENSEMBLE=ENSEMBLE
SAMPLES=SAMPLES
USER=USER