Vic Sun · Aug 11, 2020 go to post

I wouldn't recommend using ZU commands as they are deprecated so they are not guaranteed to always work.

Errors returned can occasionally be COS error codes, or they might boil down to OS error codes. It depends on the function; I don't know if there's a universal method that differentiates. I think you need to look at what you're calling. Often the class reference gives details on what error codes to expect.

In your particular case, referring to the %Library.File.CopyFile class reference:

"This method returns true if it succeeds and false otherwise. Pass return by reference to obtain the low level return value in case of errors which is the negative value of the operating system return code."

Vic Sun · Aug 5, 2020 go to post

Glad I could help!

You might find the following documentation helpful as well:

Virtual Property Paths

I have always found it useful to experiment with virtual property paths in the terminal as is explained in the bottom section of that page.

Vic Sun · Aug 4, 2020 go to post

Hi Jeff,

Perhaps you are using shorthand and I would need to see a larger sample of your code, but in your actual code are you using SetValueAt? If you're transforming HL7 messages you will need to use that method.

SetValueAt is the other side of the GetValueAt coin.

Vic Sun · Aug 4, 2020 go to post

Where does J get set? Your loop is setting h from 1:1:x. Perhaps you want to use h instead of J.

Vic Sun · Jul 30, 2020 go to post

My guess is this has something to do with your web application definitions in HealthShare, but I don't have any conclusive suggestions, so I'd second Pete's suggestion.

Vic Sun · Jul 23, 2020 go to post

Hey Jonathan,

Perhaps you've already seen them, but I'd check out these posts regarding VS Code and Atelier/Studio.

https://community.intersystems.com/post/atelier-and-studio

https://community.intersystems.com/post/intersystems-joins-open-source-…

VS Code is being worked on/developed but has not yet reached an official InterSystems 1.0 release; my bet is when it has reached a threshold of completeness it will find its way into the documentation. If you want to try out VS Code to get familiar with it and contribute to its development, that seems like a totally viable option.

Re: Atelier/Studio in the meantime, per Andreas' comment you can keep using either as they will be maintained indefinitely, they just won't see enhancements.

Vic Sun · Jul 23, 2020 go to post

Hi Jonathan,

For community edition there's IRIS and IRIS for Health, but not HealthShare or Trak. HealthShare and IRIS for Health docs are available at docs.intersystems.com (link in the top bar of the community). Not sure about Trak.

Vic Sun · Jul 20, 2020 go to post

Yes, I am familiar with this type of <PROTECT> and I'm sure I need read access for a system database. More narrowly, I think there might be 1 or a few queries that are run by the production configuration page that require that access, so perhaps full read access might not even be necessary. I was really only setting up this user to test for Carl, as I personally rely on the standard roles that don't have these problems.

Vic Sun · Jul 20, 2020 go to post

Yes, probably WRC would be the next step.

I tested on HealthShare Health Connect so I did not have the MPRL resources, but I tried making a user with R/W database permissions and just the resources you listed and was able to navigate from the SMP home page to the production page. I did get a <PROTECT> error so there's probably something still missing, but I got further than you seem to be able to.

Vic Sun · Jul 17, 2020 go to post

Good catch, I accidentally deleted an extra character while adding the underscores. Happy to help!

I did also comment on your post from last week with an example of a loop - I hope that can give you some ideas as well.

Vic Sun · Jul 17, 2020 go to post

Hi Jeff,

You're including "index" in the string. You would need to concatenate it in for it to take its value, such as:
set addarray(1) = source.GetValueAt("PIDgrpgrp(1).ORCgrp(1).OBXgrp("_index_".OBX:ObservationValue(1)")

Vic Sun · Jul 8, 2020 go to post

Hey Jeff,

I wrote up a quick sample that doesn't get quite what you wanted, but I think it's close enough that you'll be able to take it from there. If not, feel free to ask further.

My sample reverses the first FT1grps and leaves the last one in the final slot.

First I used * to get the count: Counting Fields

If you wanted to implement some more complex logic you could potentially do it here. Alternatively, you might want to write a custom utility function to perform the chunking and reversal. This keeps your code more compartmentalized and keeps too much from sitting in the DTL itself.

Defining Custom Utility Functions

Vic Sun · Jul 6, 2020 go to post

Glad you were able to get this to work, and thanks for sharing!

Vic Sun · Jul 6, 2020 go to post

Hello Eriks,

Before any other investigation I would note that Caché 5.0.21 is an extremely old version and I am surprised it even works on Windows Server 2016 as that is far outside the range of supported platforms.

If you can reproduce the behavior on a modern version of Caché, or better yet IRIS, then there may be more to look into.

Vic Sun · Jun 12, 2020 go to post

Hi Oliver,

Is your intent to have multiple productions in containers trying to pull the same types of files from the same directory to split the load? It sounds like you're not able to pull from different file paths, but would setting different FileSpecs be an option?

Perhaps setting different WorkPaths would be helpful, so that the file service(s) will move the file to another directory while processing.

Another possibility would be to have one production with a file service with a pool size >1 that routes to the various other productions.

Vic Sun · Jun 11, 2020 go to post

You can find a bunch of examples of using SetValueAt around the community, but based on what you said yes that seems right. 

Vic Sun · Jun 8, 2020 go to post

Glad you were able to figure this out.  As an additional note, the syntax Kevin suggested is a bit unusual as it is concatenating parenthetical sections. It shouldn't be necessary to do that - when you try to concatenate "(1)" you are just concatenating "1".

The following both work identically:

msg.GetValueAt("PIDgrpgrp(1).ORCgrp(1).OBXgrp(*)")
msg.GetValueAt("PIDgrpgrp("_(1)_").ORCgrp("_(1)_").OBXgrp("_("*")_")")

Vic Sun · Jun 4, 2020 go to post

How exactly is this looping code being implemented?

If I try msg.GetValueAt("OBX(*)") on an ADT_A01 for example I am able to count the OBXs. If your counter is not getting populated it suggests to me that the message's doctype may not be set or you might be using an HL7 schema that doesn't match the virtual property path.

Vic Sun · Jun 4, 2020 go to post

Hello Stuart,

Your elseif appears to have a typo of obxIndex:

elseIF GetValueAt("OBX("_obxndex_"):3.1") = "SARD" {

Besides that, you can use * to count fields rather than loop through and manually count them.

Hope that helps.

Vic Sun · Jun 3, 2020 go to post

Hi Scott,

When I try and save a rule set with improper syntax it ends up saving but not compiling, which also removes the existing int code. The problem is "caught" in that a warning is shown, though it doesn't prevent you from proceeding. My guess at the rationale would be to not blow away any incomplete work - it would be a bit of an odd restriction if you could only save a rule set if the code was valid. When the compile fails the existing compiled code is removed, so the rule set is unusable.

Vic Sun · Jun 3, 2020 go to post

Hi Scott,

Can you reproduce the compilation error not getting caught on save? When I try to save with a syntax error the rule set still saves, it does throw compilation errors however. Can you describe in more detail where the misplaced { was?

Re: your second question I'm not certain, but if the class failed to compile I'm not sure what kind of behavior we would expect from trying to use the rule set. Perhaps this is related to the particular state your environment was in.

Vic Sun · Jun 2, 2020 go to post

Hello Yone,

While you can probably figure out a way to code this in a transform, I think it would me more straightforward and legible to write a custom utility function and put your looping logic there.

Ensemble Utility Functions

Vic Sun · May 27, 2020 go to post

%ALL should cover everything from the Caché side so I suspect an OS permissions difference. Is the task doing anything that requires OS permissions (this could include writing to an output file)? Do the Caché OS user and the OS user corresponding to your account differ? What other differences could you think of between the two users? Without looking around your system I think it will be tough to troubleshoot this, so I'd recommend reaching out to the WRC.

Also, you probably already know this, but 2012 is quite an old version - I'd definitely recommend upgrading if possible.

Vic Sun · May 27, 2020 go to post

Hello István,

You can find in the docs the following:

Using the Task Manager

"If the chosen user is disabled, the task is suspended until the user is enabled and the task is resumed manually. This does not apply to built-in System tasks, which run even when the chosen user is disabled."

While the system tasks will still work while assigned to run as the disabled _SYSTEM user, it might be a good idea to set them to another user with similar permissions for clarity's sake.

The necessary resources for a task are totally dependent on what the task needs to do.