I guess I am not following. I have created class files in the past through Studio to call those globals I referenced before. I am not familiar with the CRUD method, but a simple SET ^PERSON(1) = "MIKE|MALE|Developer" should be able to set your global, and when you do a GET to pull the information out of the global you can use PIECE to split the string apart by the | . Someone out here in the development community might have a better answer for you.

Others can correct me if I am wrong, but everything Intersystems is moving to under the IRIS name.  Think of IRIS as a container with everything running under it.  Health Information Exchange (HIE), Cache Object Script, Globals, Ensemble, and etc run under what they call IRIS.

Zen is Intersystems way of creating Web Pages that talk directly with Cache.

You can use and call globals from any one of the products that you might be using. Globals works across the board, and is just another way of storing the data. In your above example think of the Person global as a variable you can call and retrieve the data

I have a global called OSUWMCLDAP that has various properties I use in some of my class files. I call this global from my class file ie like the following...

Here is examples I use in my class files to retrieve the data from the global.

#define LDAPServer $Get(^OSUMCLDAP("Server"))

Or

$Get(^OSUMCLDAP("Domain"))

Here is the same code but from the Studio (class view)

<assign value='##class(%Stream.GlobalCharacter).%New()' property='tStream' action='set' />
<assign value='source.GetFieldStreamRaw(.tStream,"ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationValue(1).AlternateText",.tRemainder)' property='tSC' action='set' />
<if condition='..Length($get(tSC))&gt;0' >
<true>
<assign value='"1"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:SetIDOBX}' action='set' />
<assign value='"ED"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ValueType}' action='set' />
<assign value='"7"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationIdentifier.Identifier}' action='set' />
<assign value='"URL"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationIdentifier.Text}' action='set' />
<assign value='"EXTLRR"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationIdentifier.NameofCodingSystem}' action='set' />
<assign value='"1"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationSubID}' action='set' />
<assign value='"PDF"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationValue(1).Identifier}' action='set' />
<assign value='"TMSAUDIO"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationValue(1).Text}' action='set' />
<assign value='"PDF"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationValue(1).NameofCodingSystem}' action='set' />
<assign value='"Base64"' property='target.{ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationValue(1).AlternateIdentifier}' action='set' />
<assign value='target.StoreFieldStreamRaw(tStream,"ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationValue(1).AlternateText", tRemainder)' property='tSC' action='set' />
<assign value='""' property='$P(tRemainder,"|",11)' action='set' />
</true>
</if>

I think I am definately being blocked along the process somewhere. I tried the above commands as Sean mentioned with a proxy and without one, but I keep running into issues.

USER>set req=##class(%Net.HttpRequest).%New()
USER>set req.SSLConfiguration="npiregistry"
USER>set req.Server="npiregistry.cms.hhs.gov"
USER>set req.Https=1
USER>set req.Port=443
USER>set sc=req.Get("/api?city=baltimore&postal_code=212")
USER>write req.HttpResponse.Data.Read(300000)
WRITE req.HttpResponse.Data.Read(300000)
^
<INVALID OREF>

USER>set req=##class(%Net.HttpRequest).%New()
USER>set req.ProxyServer="10.127.20.41"
USER>set req.ProxyPort="8080"
USER>set req.SSLConfiguration="npiregistry"
USER>set req.Server="npiregistry.cms.hhs.gov"
USER>set req.Https=1
USER>set req.Port=443
USER>set sc=req.Get("/api?city=baltimore&postall_code=212")
USER>write req.HttpResponse.Data.Read(300000)
WRITE req.HttpResponse.Data.Read(300000)
^
<INVALID OREF>

Yes I created a blank SSL/TLS confirguration called npireigstry just like you mentioned above.

I wrote out sc after executing the GET and got the following...

write sc0  [Š%<WRITE>zSend+199^%Net.HttpRequest.1 'USER #$^zSend+199^%Net.HttpRequest.1 +1 $^zGet+1^%Net.HttpRequest.1 +1X^@ +1$D^zExecute+15^%Studio.General.1 +1X^@ +1 D^runMtdLow+22^%SYS.BINDSRV +1 D^popFrame+199^%SYS.BINDSRV +1!D^ServerLoop+23^%SYS.BINDSRV +2!D^SuperConnect+34^%SYS.DBSRV +1"D^SuperServer+112^%SYS.SERVER +1

Any Idea on what this error could be?

Sean,

I tried running through your example above. When I got to set results={} ,I got the following error. Does this mean I could not get a connection outside my firewall at the Hospital?

USER>set req=##class(%Net.HttpRequest).%New()
 USER>set req.SSLConfiguration="npiregistry"
 USER>set sc=req.Get("https://npiregistry.cms.hhs.gov/api?city=balimore&postal_code=212")
 USER>set results={}.%FromJSON(req.HttpResponse.Data)
 <THROW>%FromJSON+37^%Library.DynamicAbstractObject.1 *%Exception.General Premature end of data 12 Line 1 Offset 0
USER 2e1>write results.%Get("result_count")
 WRITE results.%Get("result_count")
^
<UNDEFINED>^%Library.DynamicAbstractObject.1 *results
USER 2e1>set results={}.%FromJSON(req.HttpResponse.Data)
 <THROW>%FromJSON+37^%Library.DynamicAbstractObject.1 *%Exception.General Premature end of data 12 Line 1 Offset 0

Thanks

Scott

Yes the JDBC Gateways within the Production do stop and start when Cache' is going down and coming back up, but I am talking at the %SYS level,

Without the JDBC Gateway Server running a lot of the JDBC Gateway's (Services) start failing in the production which causes us issues.

ZSTART and ZSTOP are kind of vague, how does that fit into ccontrol start and ccontrol stop. Is there any setting where this can be set to automatic?

Scott

In a lot of places I use...

ConvertDateTime (val,in,out,file)

 

..ConvertDateTime(source.{Z01(1):DateOfBirth},"%Y%m%d","%q(1)")

%q(1) is the format.

We had a consultant write this for us as well...

 

ClassMethod FormatStringToSQLDate(InDate As %String) As %String [ Final ]
{
If InDate=""
{
set OutDate="1900-01-01 00:00:00"
}
else
{
set DateLength=..Length(InDate)
if (DateLength > 7) && (DateLength < 15)
{
set YYYY=..SubString(InDate,1,4)
set mm=..SubString(InDate,5,6)
set dd=..SubString(InDate,7,8)
set OutDate=YYYY_"-"_mm_"-"_dd
if DateLength=8
{
set OutDate=OutDate_" 00:00:00"
}
if DateLength=10
{
set HH=..SubString(InDate,9,10)
set OutDate=OutDate_" "_HH_":00:00"
}
if DateLength=12
{
set HH=..SubString(InDate,9,10)
set MM=..SubString(InDate,11,12)
set OutDate=OutDate_" "_HH_":"_MM_":00"
}
if DateLength=14
{
set HH=..SubString(InDate,9,10)
set MM=..SubString(InDate,11,12)
set SS=..SubString(InDate,13,14)
set OutDate=OutDate_" "_HH_":"_MM_":"_SS
}
}
else
{
set OutDate="1900-01-01 00:00:00"
}
}
Quit OutDate
}

}
 

We've have done something similar but wrote a function to do the looping... This example loops through a given segment and field and looks that value up against a lookup table. This could be modified for your use. This is the only way I know to do the looping within the BusinessRule.

ClassMethod GroupIDExists(pHL7Msg As EnsLib.HL7.Message, pSegment As %String, pField As %String, pLookupTable As %String) As %Boolean
{
            #dim tSeg as EnsLib.HL7.Segment
            
            set tSegCount = pHL7Msg.SegCountGet()
            set = 1
            Set tFound = 0
            //get new values
            set tval=""
            while ((<= tSegCount) && (tval="")) {
                         
                        set tSeg = pHL7Msg.GetSegmentAt(i)
                        if (tSeg.Name = pSegment) {
                                    set tID = tSeg.GetValueAt(pField)
                                    set tval= ..Lookup(pLookupTable, tID)
                                                            
                        }
                        set = + 1
            }
            if (tval '= "")
            {
                        1
            }
            quit 0
}

I am not familiar with that function.

This is how I am looking up a repeatable segment against a lookup table.

ClassMethod GroupIDExists(pHL7Msg As EnsLib.HL7.Message, pSegment As %String, pField As %String, pLookupTable As %String) As %Boolean
{
            #dim tSeg as EnsLib.HL7.Segment
            
            set tSegCount = pHL7Msg.SegCountGet()
            set = 1
            Set tFound = 0
            //get new values
            set tval=""
            while ((<= tSegCount) && (tval="")) {
                         
                        set tSeg = pHL7Msg.GetSegmentAt(i)
                        if (tSeg.Name = pSegment) {
                                    set tID = tSeg.GetValueAt(pField)
                                    set tval= ..Lookup(pLookupTable, tID)
                                                            
                        }
                        set = + 1
            }
            if (tval '= "")
            {
                        1
            }
            quit 0
}

Not sure how you would do that with XECUTE