Dmitry Maslennikov · Sep 17, 2016 go to post

I managed to work it, I've just extended Cache dialect for Hibernate, and changed GlobalTemporary table which is not support DROP to LocalTemporaryTable. And changed column type for boolean, for supported in Caché data type bit. And looks like, I get working FHIR server which stores all data in Caché.

public class CacheDialect extends Cache71Dialect {

    public CacheDialect() {
        super();
        this.registerColumnType(Types.BOOLEAN, "bit");
    }

    @Override
    public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy() {
        return new LocalTemporaryTableBulkIdStrategy(
            new IdTableSupportStandardImpl() {
                @Override
                public String generateIdTableName(String baseName) {
                    final String name = super.generateIdTableName( baseName );
                    return name.length() > 25 ? name.substring( 1, 25 ) : name;
                }

                @Override
                public String getCreateIdTableCommand() {
                    return "create global temporary table";
                }
            },
            AfterUseAction.DROP,
            null
        );

    }

}
Dmitry Maslennikov · Sep 19, 2016 go to post

It does not matter CSP-page or terminal process, for $ZF(-1). Only one issue which may be in your case, if this application is interactive. In this case, Windows may prevent to run such application, just because it works as a service, but it is possible to change it if you allow interactive mode for service of this instance Cache.

Dmitry Maslennikov · Sep 20, 2016 go to post

I've used Delphi so long ago, and could be mistaken. But to be sure that application is not interactive, it should not have any visual components. And as I remember you should start developing from Console Application. To check that actually it does work correctly, you may try with real console tool, something like: dir, md, etc.. You may try this $zf(-2,"dir > testdir.txt"), if after executing this code testdir.txt file will appaer with content for some folder, you'll see that it's work. And it means that in your application should be changed something to be as console application.

Dmitry Maslennikov · Sep 21, 2016 go to post

What does you mean ? In this case we get all data in property Name, if you need data from other property just use it.

Write !,obj.Address
Dmitry Maslennikov · Sep 21, 2016 go to post

in your code,

obj - it is some object, it may have some ID or not, if it just created

name1 - it is a value for property name in that object

but I completely don't understand why is here name2 and name3, and what do you suppose should be happens after this line ?

and how it should save data in other objects which we even don't know which ?

you should know somehow which objects you want to update. If you know only some other properties, you can use SQL command UPDATE 

Dmitry Maslennikov · Sep 22, 2016 go to post

I'm just in the begin, I'm working on developing FHIR-based application, and currently it's enough, mostly because so far for production.  

Dmitry Maslennikov · Sep 27, 2016 go to post

Ok, looks like, it does not matter who tried to connect to cache, any terminal access is forbidden. 

You should allow Password or Unauthenticated method for %Service_Terminal.

Dmitry Maslennikov · Sep 27, 2016 go to post

Sorry my mistake, I don't have widows system currently, for windows you should change %Service_Console

to check access, you may use this command

..\bin\cache -s.

Powershell or cmd does not matter.

Dmitry Maslennikov · Sep 30, 2016 go to post

Have you tried it in cmd.exe instead of PowerShell, or the same troubles there ?
Please show screenshots from page Securty, Services

I think you can create some issue in this repo
you can also look at my example of Dockerfile, when I delete installation folder in the same command RUN with installation, which should became in the same layer

    set url="http://www.intersys.com/main.csp?a=b&QUERY=abc&QUERY=xyz"
    Do ##class(%Net.URLParser).Parse(url, .aComponents)
    
    set query=$lfs($get(aComponents("query")),"&")
    for i=1:1:$ll(query) {
        set $lb(name,value)=$lfs($lg(query,i),"=")
        set index=$order(data(name,""),-1)+1
        set data(name,index)=$g(value)
        set data(name,index,"O")=i
    }
    zwrite data

 

data("QUERY",1)="abc"
data("QUERY",1,"O")=2
data("QUERY",2)="xyz"
data("QUERY",2,"O")=3
data("a",1)="b"
data("a",1,"O")=1
Dmitry Maslennikov · Oct 11, 2016 go to post

Your clarification does not help actually. But any way, deleting any object, leave just ID on a link, and again, everything here depends on your application. In most cases it could cause for some different issues, when application have not expected deleted object. And I would recommend to use some flag like "isDeleted", which can help to hide such objects in most of places, and still have an access to the content of this object, to show if it would be needed. Completely delete object recommended only in case when no any other objects has links to this one. 

Dmitry Maslennikov · Oct 15, 2016 go to post

Please add more details. What HTML report? And what the final goal, you have to achieve ?
Looks like you have to use %Net.HttpRequest, but I'm not sure, because of your description.

Dmitry Maslennikov · Oct 17, 2016 go to post

There are lots of ways how to export data in CSV format in Caché. Add here your or code, or some more information. How you did it, and after that we may help.

Dmitry Maslennikov · Oct 17, 2016 go to post

I think not so many people know about Ultiview and even how it could be connected with Caché. 

So, in this case, you should some more details in your topic, how it connected, and how this question depends on Caché.

Dmitry Maslennikov · Oct 17, 2016 go to post

XLS, files much more difficult that plain CSV. And depends on which version you want. XLS - it is a binary format, but XLSX already bunch of XML files but compressed in one file.

You can try to use ZEN reports, which supports XLS as one of output formats.

Dmitry Maslennikov · Oct 19, 2016 go to post

I'm just looked at another examples in other dialects. I'm not so good in Java yet, and even in Hibernate, and not sure that my way is correct.

Dmitry Maslennikov · Oct 19, 2016 go to post

Thanks for sharing this. But some comments about code.

  • postconditionals is a very good part of our language, but here is too much, and quite difficult to read such code. In this case much better will be simple if else
  • return in try block is a bad idea, you should throw an error, which will be caught anyway
  • we can do new $namespace, but in your code, this method returns to wrong namespace, look at my previous point
  • instead of $replace(database,"/","\"), use ##class(%File).NormalizeDirectory(database), in this case you should not check on OS, even you forgot some of OS's, and in this case NormalizeDirectory/NormalizeFilename, a bit better.
  • verbose mode will be better to do with a macros, something like $$$DebugInfo("some message")
  • In your code I see so many checks on errors, and looks like, after such error we should exit, but you go further. You should look at some system macroses like $$$ThrowOnError() and so on, I think you should use it. And code will much more clear for readers
  • and at the end you have some call to method checkRW, I think you should remove it, or show this method, because it's not clear what it does

And, before publishing, please change tabs to spaces, because tabs here is too big. And width of lines should be a bit less, because read such long lines a bit difficult. 

I fixed tabs here, for more readability.

Dmitry Maslennikov · Oct 20, 2016 go to post

Just noticed, that some time, my HAPI-FHIR server which connected to Ensemble, responses too long on some queries. And found that on Ensemble side, too many lock, and looks looks some of them in a dead-lock, and not sure why is happens yet.

Dmitry Maslennikov · Oct 21, 2016 go to post

Yes, but in this code, for me is too mach, and also, postconditionals should be quite short, like sc, and should not be more or close to length of real statement