Caché

Syndicate content 118 

Hi All, 

I am providing support to an AP about using document criteria on Multiple Templates (Explicit Dispatch).

I am trying to set the  criteria value from:

view.setDocumentKey('initial-search',{patirntId:tPatId});

 However it is not possible to get the criteria value on %GetJSONContent through pCriteria parameter object.

How can I do this with Multiple Templates on bootstrap plugin?

Thanks.

Last answer 17 May 2016
0   0 1
0

comments

147

views

0

rating

Hi, 
My name is Sergio Fernandes and I'm from Brazil.
I would like to know how can i use MVBasic at Cache Terminal or .csp.
My original problem is to converter Integer Numbers to Roman Numbers and consulting cache documentation I found "Conversion Codes" at http://localhost:57772/csp/docbook/DocBook.UI.Page.cls?KEY=GVRF_basicfeatures#GVRF_B127632
My version is Intersystems Ensemble 2013.1.6.950.0
Thanks a lot,

Sérgio Fernandes

Last answer 16 May 2016 Last comment 17 May 2016
0   0 3
230

views

0

rating

NewBie's Corner Session 2 Variables Set and Write commands

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

Session 2 – Click on the Caché Cube in your system tray and select Terminal to try out the commands.

Variables

Like other computer programming languages, Caché uses Variables and the values they represent to control programming. Variables are elements that represent data values. Manipulating and interrogating variables is at the root of programming.

  • Variable names are case-sensitive
  • Variable names should be no longer than 31 characters
  • Variable names must be either Alpha or Numeric characters. No underscores or dashes
  • Variables must start with either "%" or an alpha character (A, B, C . . . Z), lower or upper case
  • By convention, variable names that start with "%", are reserved for the system

Set command

+ 2   0 3
0

comments

208

views

+ 2

rating

Hello, our customer, large industrial company, is considering modernizing their old CSP application so it can run on multiple client device types, using responsive design.

They have a lot of experience with CSP and some ZEN.

They are new to REST and have some limited knowledge of javascript - perhaps not enough to the extent used by client framework.

Does anyone have a framework or a set of templates that you would be willing to share?

Thank you!

Dan Kutac 

Last answer 16 May 2016 Last comment 16 May 2016
+ 2   0 0
521

views

+ 2

rating

Hello,

I'm trying to connect to a Caché server from Atelier; the Caché server is 2015.x.

The address and port I'm trying to connect to is the SQL gateway server; and I get, each time, an "unexpected end of file from server".

Note that unfortunately, for the moment, I connect as _system... And the Caché install has the default privileges.

What am I doing wrong?

Last answer 13 May 2016
+ 1   0 1
0

comments

302

views

+ 1

rating

This is a bit weird.  I'm trying to use `DATEDIFF()` to calculate the time since the last message on an interface.  For some reason, when no messages are received, the number steadily decreases.  This is the opposite of what should happen.  Here is my current query and a few sequential result sets:

SELECT getDate() as now, max(TimeCreated) as latest, DATEDIFF (s,getdate(), max(TimeCreated)) as difference
FROM EnsLib_HL7.Message

 

now                  latest               difference  
-------------------  -------------------  ----------  
2016-05-13 11:05:31  2016-05-13 08:51:16  9945
2016-05-13 11:08:16  2016-05-13 08:51:16  9780    
2016-05-13 11:08:36  2016-05-13 08:51:16  9760 

Last answer 13 May 2016 Last comment 13 May 2016
0   0 1
375

views

0

rating

Hi,

If you want to import data from a mySQL export file (exported with mysqldump), you will find here a little script that could help.

Only the INSERT commands in the sql file are executed into Caché. Indices are not computed for better performance.
%NOINDEX, %NOCHECK and %NOLOCK are generated on each INSERT line.

Currently, the file can not contain a "),(" pattern inside the values part of the INSERT command. If this is the case, the line is skipped. This feature may be implemented in the extractValuesList method.

Feel free to improve it as needed. Unfortunately it's not guaranty bug free for the moment!

mysql.tools.xml_0.zip

Last comment 13 May 2016
+ 2   0 2
243

views

+ 2

rating

Hi -

 

I'm trying to figure out what is the best (or at least pros & cons) on how to manage login accounts in a multi-tenant SaaS web based application context.

Assume that a company is designing a collections of web based applications that they will be selling as "services" to their clients, and that these clients will each have their own "users" and "customers" that will be logging into these services.

In setting up these login accounts for the "users/customers" of the "clients" of the "company", does setting up a unique domain/user-pool context for each "client" make the most sense? And if so, when deploying updates to the applications, would each domain/user-pool context be replicated environments that would each need to be updated?

(I'm trying to figure out what makes any sense in terms of web-login-account management and ease of top-level administration)

Last answer 10 May 2016 Last comment 12 May 2016
0   0 2
236

views

0

rating

Hi!

I believe the simplest is (to work with csv delimited by ";"):


set file = ##class(%File).%New( "data.csv" )
    set sc = file.Open( "R" ) 
    if $$$ISERR(sc) quit    ; or do smth

    while 'file.AtEnd {
        set str=file.ReadLine() 
        for i=1:1:$length( str, ";" ) {
            set id=$piece( str, ";" ,i ) 
            write !, id  // or do smth
        }
    }
    do file.Close()

Possible options:

different variants of error handling with sc code.

Embrace while loop into try/catch block.

And what's yours?

Last comment 12 May 2016
0   0 6
2495

views

0

rating

Often when debugging COS code you get an error message such as '<UNDEFINED>test^routine *test' so the first thing you want to do is to take a look at this code and see what it is doing. From the command line you can:

ZLOAD routine ZPRINT test

Which means splitting the $zerror information into the routine name and the line and adding the zload/zprint commands. Also you often want to view the lines above the one where the error happened as this gives you some context of how you got to this line, using ZPRINT you could 'ZPRINT +1:test' but that may display hundreds of lines.

Since 2013.1 you can use ZZPRINT as follows:

ZZPRINT "test^routine":10

Which will print the 10 lines before the 'test^routine' line, so here you can cut/paste the line reference directly into the command and you can specify the number of lines before or after using this syntax where both the before or after can be blank

Last comment 12 May 2016
+ 5   0 5
484

views

+ 5

rating

I have some logging code that outputs task status information to a log file. I would like to make the log available for reading while it is open for writing. The file is opened using the "L" option (Lock):

Open tLogFile:"WASL" Set tLogOpen=1


My intent was to prevent multiple processes from accidentally writing to the file and having messy output. Unfortunately, if the process is taking longer than expected, one can not simply open the log file to figure out what is going on because the "L" lock prevents the file from being opened for reading as well as writing.

Is there a simple way to enforce a single writer but allow many readers?

I am thinking that I may just have to take out a regular COS lock when opening the file, and release the lock when closing the file, but if I can just change the flags on the Open command, I would rather know how to do that.

Thanks,

Derek

Last answer 11 May 2016
0   0 1
0

comments

190

views

0

rating

This question came on the Ensemble in Healthcare email list. It's a great question. I'm working on an answer, but am posting it here to get any other input. I'll also address the option of using %CSP.REST.

Hello everyone,

 

Using Intersystems Healthshare/Ensemble, I am trying to make a RESTful Interface between Android/iOS app and Cache database. I have some queries and I am unable to find where exactly I can get any resources on them.

Last answer 10 May 2016 Last comment 25 March 2016
+ 2   0 2
6456

views

+ 2

rating

Greetings! This article describes yet another simple way of creating installers for the solutions based on InterSystems Caché. The topic covers applications, which can be installed or completely removed from Caché with one action only. If you are still documenting installation instructions that have more than one step to do to install your application — it’s high time you automated this process. 

Last comment 10 May 2016
+ 5   0 6
1012

views

+ 5

rating

I am trying to execute a system query. - %SYS.Journal.File_Search()

The Query is looking for a Journal File Name and a String.

However, the Query line accepts no parameters. - Query Search() As %Query(ROWSPEC = "Offset:%Integer")

But in the SearchExecute method if checks for File and String.

ClassMethod SearchExecute(ByRef qHandle As %Binary, String As %String, FileName As %String . . .
{
                i $g(String)="" q $$$ERROR($$$JournalFileSearchUndefined)
                i $g(FileName)="" q $$$ERROR($$$JournalFileUndefined)

Can anyone help me understand how the String and FileName is passed into the query?

 

Last answer 9 May 2016 Last comment 10 May 2016
+ 1   0 2
503

views

+ 1

rating

Our company is looking for someone with expert object script skills and experience developing with REST using Caché. We have an existing application that currently supports a mobile application and a web application. The API is up and running but we need another developer to add new features and keep up with demand.

Experience with Amazon AWS is highly desired as the api is running on Windows in EC2. Familiarity with GitHub is also required.

Pay can be negotiated on a per hour basis after you provide an estimate for the time required to complete a given feature.

We are looking for 25-30 hours per week. If you are interested, please contact developers@pionetix.com

 

0   0 1
0

comments

207

views

0

rating

Hi!

Want to share with you code snippet of try catch block I usually use in methods which should return %Status. 


{ 
 try {
  	$$$TOE(sc,StatusMethod())
 }
 catch e {
 	set sc=e.AsStatus()
 	do e.Log()
 }

Quit sc 
}

Here $$$TOE is a short form of $$$TROWONERROR macro.

Inside macro StatusMethod is any method you call which will return %Status value. This value will be placed into sc variable.

In case of sc contains error execution will be routed to try catch block. You can wrap any Status methods calls in your code if you need to catch the errors coming from them.

In try catch block I place my logic and have to mandatory calls:

s sc=e.AsStatus() to get the status of error.

D e.Log()  - to place all the stack of error to standard Application Error log which you can find in Management portal on this page

Last comment 9 May 2016
+ 2   0 7
1241

views

+ 2

rating

The purpose of this post is to raise the profile of a powerful mechanism that has long been available to us, and to open a discussion about ways in which it can be used or abused.

You can read more detail about the mechanism here. To summarize, your class definition can use the Projection keyword to reference one or more projection classes. A projection class can implement methods that get invoked at key points in the lifecycle of your class.

A projection class must extend %Projection.AbstractProjection and will typically implement at least one or the following methods

Last comment 9 May 2016
+ 7   0 10
829

views

+ 7

rating

We are in the process of putting a new UI on the existing product documentation, including a mobile-optimized view. We also plan on releasing additional "solution based" documentation that is targeted at common usage scenarios or important configuration tasks.

We are interested in your feedback on our current product documentation - what you like and dislike and especially what changes you would expect to see to make it as useful as possible.

Last comment 6 May 2016
+ 3   0 9
619

views

+ 3

rating

You may experience errors executing Java programs that rely on the JAVA_HOME environment.

For example when Create PDF from this pivot in DeepSee or in this case, outputting a Zen Report as PDF.

You can verify the PDF generation configuration by clicking on the Verify Now button on the Management Portal System > Configuration > Zen Report Settings page:

  

 

Outputting a Zen Report as PDF causes an error, for example ZENApp.MyReport.cls in the SAMPLES namespace:

 

Using the URI Query Parameter $LOG=1:

+ 1   0 1
0

comments

262

views

+ 1

rating

Good afternoon, I have working prototypes of each of these approaches. I do not have an expansive cache background.

I have a couple of projects where I am ingesting files from disk.

The name of the file contains a lot of the information I will need to reference the file in the future.

What are the advantages and dis-advantages of these two approaches:

Store the whole filename and use SqlComputeCode to populate properties in a class?

Last answer 5 May 2016 Last comment 5 May 2016
+ 1   0 1
297

views

+ 1

rating

On the class reference %Library.GlobalCharacterStream is marked as deprecated in favor of  %Stream.GlobalCharacter.

How I can migrate the data from class properties defined as %Library.GlobalCharacterStream to the new one %Stream.GlobalCharacter? 

Does the %Stream.GlobalCharacter have the same SQL support from %Library.GlobalCharacterStream?

Thanks.

Last answer 2 May 2016 Last comment 4 May 2016
+ 1   0 3
589

views

+ 1

rating

Hi,  The ZEN Mojo Widget reference at ../csp/sys/%ZEN.Mojo.WidgetReference.bootstrap33xHomepage.cls is a great reference for viewing the different components available with each helper plugin - and it also supplies snippets of JSON code to use in your layout definitions.

 

I'm having problems with the Bootstrap $navbar component however. This is layout definition, with a navbar and button contained within the bar.:

Last answer 4 May 2016
0   0 1
0

comments

184

views

0

rating

I was trying to modify the REST.DocServer sample in the SAMPLE namespaces to use the new %Object and %Array system objects (Ensemble 2016.2 build 636) with the following changes:

/// This method returns a list of namespaces for this server

ClassMethod GetNamespaces() As %Status

{

    #dim tSC As %Status = $$$OK

    #dim tList,tNS,tFilteredList,tValue As %String

    

    #; Get the list of namespaces

    Do List^%SYS.NAMESPACE(.tList)

    Set tNS="" For  {

    

        Set tNS=$Order(tList(tNS),1,tValue) If tNS="" Quit

    

        #; Only want namespaces which are enabled and are not remote

        If $List(tValue,1)=1&&$List(tValue,2)=0 {

            Set tFilteredList(tNS)=""

        }

    }

    

    #; If we have been asked for json

    If $Get(%request.CgiEnvs("HTTP_ACCEPT"))="application/json" {

      

Last answer 3 May 2016 Last comment 3 May 2016
0   0 3
264

views

0

rating