Ashok Kumar T · Jul 21, 2024 go to post

Thanks Robert,

The validateIndices() and absolutely It's useful. For the first point. As far of my understanding both existing/newly created index both are set as "not selectable" at the time of building BUILD Index/%BuildIndices().  As per the documentation about the live system "not selectable" by default in BUILD INDEX. So, Does it applicable for programmatic %BuildIndices() as well?

Ashok Kumar T · Jul 20, 2024 go to post

Hello @Yone Moreno 

Try this below input in your DTL. Because the property Informes as a list so you have to create the xml data like below  Property Informes As list Of EsquemasDatos.DragoAP.Portal360.Informes(XMLNAME = "Informes");

You can create a main object and set all the properties and use obj.XMLExportToString(.xmlString) for the xml structure of the class object. That will be helpful for forming the input  for DTL as well.

<InformeVisitaRequest>
	<Paciente>
		<NumExpediente>12</NumExpediente>
		<Informes>
			<Informes>
				<Fecha_Creacion>tescreation</Fecha_Creacion>
				<Id_Visita>tesVistia</Id_Visita>
				<Titulo>tesTitulo</Titulo>
				<Desc_Tipo_Plant>Desc_Tipo_Plant</Desc_Tipo_Plant>
				<NumExpediente>1212</NumExpediente>
			</Informes>
		</Informes>
	</Paciente>
</InformeVisitaRequest>

Thanks!

Ashok Kumar T · Jul 17, 2024 go to post

Hello Mihoko,

Really useful class to get the errors. I did some slight modification in that code to use it

ClassMethod GetErrorLogs(pDate = {$H})
{
	Set oldNamespace = $Namespace
	New $Namespace
	Set $Namespace= "%SYS"
	Set tResult = ##class(SYS.ApplicationError).ErrorListFunc(oldNamespace,$ZDate(pDate))
	Do tResult.%Display()
}
Ashok Kumar T · Jul 16, 2024 go to post

Hello @Martin Nielsen 

Quick note, You can get the manually created web applications via /v1/{namespace}/restapps in the web application "/api/mgmnt" ex: http://localhost:52773/api/mgmnt/v1/learning/restapps. This will list down all the v1 applications and from that you can use the web app name to get the openAPI(swagger 2.0) by using the the url /v1/{namespace}/spec/{web app name} ex: http://localhost:52773/api/mgmnt/v1/learning/spec/dc/samprest

Ashok Kumar T · Jul 16, 2024 go to post

Thanks a lot @Tani Frankel 

I reinstalled the instance as unicode system and the  <WIDE CHAR> error is gone. I could able to see the couple of endpoints in web app and  access the fhir sql home page without any issues. 
So, How can I resolve this same issue in the 8 bit legacy system. Do you think this is an serious issue in 8 bit? 

Regards,

Ashok.

Ashok Kumar T · Jul 15, 2024 go to post

Here is the details from the HS.Util.Installer.HSSYS-0.log file. I don't see "HS.HealthConnect.FHIRSQL.Upgrade.V2:InstallOnce-HSSYS-1 Configured FHIRSQL Application endpoints". Anyway I could able to see the FHIR endpoints in  2024.1 (build 267.2)  in other machine. However I'm unable to connect the page http://hostname:portnumber/csp/fhirsql/index.html#/


2024-07-13 20:20:08.984 HS.Util.Installer.ConfigItem:CreateDatabaseAndNamespace About to Create Database hssys
2024-07-13 20:20:09.120 HS.Util.Installer.ConfigItem:CreateDatabaseAndNamespace Created IRIS.DAT in c:\intersystems\irishealth\mgr\hssys
2024-07-13 20:20:09.189 HS.Util.Installer.ConfigItem:CreateDatabaseAndNamespace Made Namespace hssys
2024-07-13 20:20:11.169 HS.Util.Installer.ConfigItem:MapIPM Added package mapping: %IPM from HSLIB to HSSYS
2024-07-13 20:20:35.475 HS.Util.Installer.ConfigItem:CreateWebApplicationForRESTServices Created web application for REST Services: /api/healthshare-rest/hssys

And I did not see "HS.HealthConnect.FHIRSQL.Upgrade.V2:InstallOnce-HSSYS-1 Configured FHIRSQL Application endpoints"  and anything  related to FHIR SQL API in ensinstall.log  as well. I found some error message

     Starting HealthShare Foundation Security Upgrade
      Adding %HSAdmin_InstallationManagement to %EnsRole_Developer and EnsRole_Administrator roles
Created additional Security Roles and Resources
Created web applications for HSLIB
HS.Util.Installer.ConfigItem:CreateWebApplicationForRESTServices Created web application for REST Services: /api/healthshare-rest/hssys
Created web applications for HSSYS
Created web applications for HSCUSTOM
      + Installed component HSLIB Failed ERROR #5002: ObjectScript error: <WIDE CHAR>AddSchemaType+150^%XML.Schema.1
Installation failed: ERROR #5002: ObjectScript error: <WIDE CHAR>AddSchemaType+150^%XML.Schema.1

 

Thanks!

Ashok Kumar T · Jul 14, 2024 go to post

Thanks @Robert Cemper 
I've go over the documentation and the hash value represents that's an embedded SQL cached query and ends with integer is dynamic SQL. But why the both cached queries are generated while running the sql in management portal. AFAIK, I haven't seen these two cached queries in some other versions. 

Ashok Kumar T · Jul 14, 2024 go to post

Hello Tani,

No problem, It's actually a valid question. I downloaded and installed InterSystems IRIS for Health. I had created FHIR resource repositories as well. But I'm unable to see the FHIR SQL endpoints

USER>write $ZV
IRIS for Windows (x86-64) 2024.1 (Build 267.2) Tue Apr 30 2024 16:42:56 EDT
USER>Write ##Class(%ZHSLIB.HealthShareMgr).IsIRISHealthInstance()
1
Ashok Kumar T · Jul 5, 2024 go to post

Hello @Scott Roth 

The OnInit Method executed once start/restart a Business Operation. Maybe You can create additional HTTP Business operation and call this operation based on the create/renewal for OAuth token.  Eventually you can call that operation as sendrequestsync and get the token in your actual business operation. Please share if any additional thoughts about this flow.

Thanks!

Ashok Kumar T · Jul 4, 2024 go to post

Hello @Martin Nielsen

I did some analysis about this. As of my understanding, I found this is because of the method DispatchRequest in the %CSP.REST. The below piece of code is actually skip your accountId due to forward your request to another "DispatchRequest" in the other dispatch class(for your case "AnotherController" class). But these are rewritten in IRIS already. You can try override this method for testing.

Set tMatchUrl=$Piece(tMatchUrl,tMatchcher.Group(1),"2",*),tForward=$LisGet(tMapEntry,3)
Actual Url: /1001/anothercontroller/001
Url after above line executed: /001
Ashok Kumar T · Jul 4, 2024 go to post

Hello @Sylvie Greverend

The sample swagger for produces "image/jpeg" and consumes "application/json" and "application/xml" for sample. Once the spec.cls. Once it's complied it creates a "DownloadImg" classmethod in .disp.cls

swagger

{
	"swagger": "2.0",
	"info": {
		"title": "test",
		"version": "1.0.0"
	},
	"paths": {
		"/Test": {
			"get": {
				"summary": "Test download",
				"operationId": "DownloadImg",
				"produces": [
					"image/jpeg"
				],
				"consumes": [
					"application/json",
					"application/xml"
				]
			}
		}
	}
}

Generated class method

ClassMethod DownloadImg() As %Status
{
    Try {
        Do ##class(%REST.Impl).%SetContentType("image/jpeg")
        If '##class(%REST.Impl).%CheckAccepts("image/jpeg") {
            Try {
                Do ##class(MyLearn.LearnREST.Swag.impl).%ReportRESTError(..#HTTP406NOTACCEPTABLE,$$$ERROR($$$RESTBadAccepts))
            } Catch {
                Do ##class(%REST.Impl).%ReportRESTError(..#HTTP406NOTACCEPTABLE,$$$ERROR($$$RESTBadAccepts))
            }
            Quit
        }
        Set response=##class(MyLearn.LearnREST.Swag.impl).DownloadImg()
        Do ##class(MyLearn.LearnREST.Swag.impl).%WriteResponse(response)
    } Catch (ex) {
        Try {
            Do ##class(MyLearn.LearnREST.Swag.impl).%ReportRESTError(..#HTTP500INTERNALSERVERERROR,ex.AsStatus(),$parameter("MyLearn.LearnREST.Swag.impl","ExposeServerExceptions"))
        } Catch {
            Do ##class(%REST.Impl).%ReportRESTError(..#HTTP500INTERNALSERVERERROR,ex.AsStatus(),$parameter("MyLearn.LearnREST.Swag.impl","ExposeServerExceptions"))
        }
    }
    Quit $$$OK
}

Some useful links 

HTH.

Ashok Kumar T · May 29, 2024 go to post

Hello @Scott Roth 

Did you get a chance to check the ^ISCLOG global for Http request logging. Because configuration done int ^%ISCLOG and logging was written in ^ISCLOG

^FSLOG for internal FHIR server logging 

Thanks!

Ashok Kumar T · May 1, 2024 go to post

I don't have any granular level samples right now. Generally speaking, it depends on our code implementation how we get the payload data from the system/upstream stream. There are certain validation based on the requirements. So, I hope there is no general mapping to convert our information into SDA. 

Thanks!

Ashok Kumar T · Apr 25, 2024 go to post

Hello @isabella Barnes 

I'd create some custom container. Check, modify and validate all the fields in payload by using some additional DTL's and Code from the and mapped into the custom container. Then I created a DTL mapping and map the custom container with the InterSystems intermediary format HS.SAD3.Container 

Finally use the container object to generate the FHIR resource.

/// custom conatiner class
Class Test.project.CustomContainer Extends (Ens.Request, %JSON.Adaptor)
{

/// (Custom Persistent class with HS.SDA3.Medication)
Property Medication As Medication;

Property Procedure As Procedure;

/// (Custom Persistent class with HS.SDA3.Procedure)
Property Referral As Referral;

/// (Custom Persistent class with HS.SDA3.Referral)
Property Appointment As Appointment;

/// (Custom Persistent class with HS.SDA3.Appointment)
Property Immunization As Immunization;

/// (Custom Persistent class with HS.SDA3.Vaccination)
Property Diagnosis As Diagnosis;

/// (Custom Persistent class with HS.SDA3.Diagnosis)
    
}

/// additional support class
Class Test.project.Medication Extends (Ens.Request, %JSON.Adaptor)
{

/// Add your fields
/// 
Property Context As %String(MAXLEN = 250);

/// Relevant to Medication Requests, this represents whether a  request is a proposal, 
/// plan, or an original order.
/// VIEWERLIB: Not stored
Property RequestIntent As HS.SDA3.CodeTableDetail.MedicationRequestIntent;

/// Indicates if this record was captured as a secondary 'reported' record rather than 
/// as an original primary source-of-truth record. 
/// VIEWERLIB: Not stored
Property IsReported As HS.SDA3.Boolean;

/// etc........

}
Class Test.project.Procedure Extends (Ens.Request, %JSON.Adaptor)
{

/// Add your fields
/// 
Property EnteredOn As HS.SDA3.TimeStamp;

/// HL7:  PR1-19.1 : ProcedureIdentifier.EntityIdentifier<br>
/// VIEWERLIB: User.HS.MRProcedures(PROCExternalId)
Property ExternalId As %String(MAXLEN = 220);
/// etc........
}

DTL Mapping

Class Test.project.DTL.CustomToFHIRMapping Extends Ens.DataTransformDTL [ DependsOn = (Test.project.CustomContainer, HS.SDA3.Container) ]
{

Parameter IGNOREMISSINGSOURCE = 1;

Parameter REPORTERRORS = 1;

Parameter TREATEMPTYREPEATINGFIELDASNULL = 0;

XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ]
{
<transform sourceClass='Test.project.CustomContainer' targetClass='HS.SDA3.Container' create='new' language='objectscript' >
<assign value='source.Medication' property='target.Medications.(1)' action='set' />
<assign value='source.Procedure' property='target.Procedures.(1)' action='set' />
<assign value='source.Referral' property='target.Referrals.(1)' action='set' />
<assign value='source.Appointment' property='target.Appointments.(1)' action='set' />
<assign value='source.Diagnosis' property='target.Diagnoses.(1)' action='set' />
</transform>
}

}

screenshot of DTL

This is how I approach the conversion.

Thanks!

Ashok Kumar T · Apr 13, 2024 go to post

Hello @Parameshwaran Muthaiyan 

The current approach you have implemented is the exact approach. because, You have to execute the query every time if we are modify the conditional values. Otherwise the results will remine the same.

Ashok Kumar T · Feb 6, 2024 go to post

Usually you will get a serialization JSON (string)  in result. You can do deserialization by using %DynamicObject.

Ashok Kumar T · Feb 4, 2024 go to post

Hi @Pierre LaFay 

Define a Method instead of  ClassMethod and Instantiate the object for that class and call the required method. It will work

Class Bna.Utils.Sql Extends %RegisteredObject
{

ClassMethod RemoveIrisTestUsers() As %Status
{
    set obj = ..%New()
    New $NameSpace
    Set $NameSpace="%SYS"
    // Get test users by login begining
    Set query = "select * from Security.Users "_
                "where "_
                    "ID like LOWER('ARS%') or"_
                    "ID like LOWER('CHERCHEUR%') or"_
                    "ID like LOWER('CS%') or"_
                    "ID like LOWER('DGOS%') or"_
                    "ID like LOWER('CENTRE%')"
    Set sc =obj.SelectFirstColsInArray(query, .userIds)
    if 'sc Return sc
    zw userIds

    Return $$$OK
}

Method SelectFirstColsInArray(query, test)
{
    zwrite query,test
    return $$$OK
}

}