go to post Ashok Kumar · Aug 29, 2023 As per your code. Couple of things. Firstly, the item is list of object so you should use Insert method. You're inserting item.ItemName instead item object. Property Item As list Of AllItems; expects object. Not a string. Do AllItem.Item.Insert(Item)
go to post Ashok Kumar · Aug 24, 2023 I'm not sure why the request class CSVtoHL7.Inputfile.Record inherits from right. All the request and response are required persistent object. This will be used to display the entire flow in the visual trace section. I have attached some sample below. You can add a property setter method for property DOB and modify the value from MM/DD/YYYY to +$H value. This will keep the internal date format in database. Class CSVtoHL7.Inputfile.Record Extends (Ens.Request, %XML.Adaptor, EnsLib.RecordMap.Base) [ ProcedureBlock ] { Property ID As %Integer; Property LastName As %String; Property FirstName As %String; Property MiddleName As %String; Property DOB As %Date; Method DOBSet(pDate) As %Status { Set i%DOB= $ZDH(pDate) Quit $$$OK } Property Gender As %String; ClassMethod createObj() As CSVtoHL7.Inputfile.Record { Set obj = ##class(CSVtoHL7.Inputfile.Record).%New() Set obj.DOB="12/30/2001" Set obj.FirstName="Test" Set obj.ID=12345 Set obj.MiddleName = "middle" Set obj.Gender="M" return obj } } Create a object for the request class and send to Transformation. you can use the logic $translate($ZDT(source.DOB_",0",3)," ","T")_"Z" in DTL to convert the internal date format to required output 2023-08-24T00:00:00Z. You can refer the DTL sample below Class CSVtoHL7.DTL.Record Extends Ens.DataTransformDTL [ DependsOn = (CSVtoHL7.Inputfile.Record, EnsLib.HL7.Message) ] { Parameter IGNOREMISSINGSOURCE = 1; Parameter REPORTERRORS = 1; Parameter TREATEMPTYREPEATINGFIELDASNULL = 0; XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ] { <transform sourceClass='CSVtoHL7.Inputfile.Record' targetClass='EnsLib.HL7.Message' targetDocType='2.5:ADT_A01' create='new' language='objectscript' > <assign value='source.ID' property='target.{PID:SetIDPID}' action='set' /> <assign value='source.FirstName' property='target.{PID:PatientName().FamilyName}' action='set' /> <assign value='source.MiddleName' property='target.{PID:PatientName().GivenName}' action='set' /> <assign value='source.Gender' property='target.{PID:AdministrativeSex}' action='set' /> <assign value='$translate($ZDT(source.DOB_",0",3)," ","T")_"Z"' property='target.{PID:DateTimeofBirth.Time}' action='set' /> </transform> } } output
go to post Ashok Kumar · Aug 24, 2023 As we mentioned above the DOB should have +$H value instead of MM/DD/YYYY. However you can try the below If DOB is date format IRISMYDEV>set dob="12/01/1993" IRISMYDEV>write $translate($ZDT($ZDTH(dob),3)," ","T")_"Z" 1993-12-01T00:00:00Z If DOB is +$H value IRISMYDEV>set dob=+$H IRISMYDEV>write $translate($ZDT(d_",00000",3)," ","T")_"Z" 2023-08-24T00:00:00Z
go to post Ashok Kumar · Aug 23, 2023 Hello Smythe, I agree with @Robert Cemper points. The %Date datatype is for +$H which means numeric date value. Not an string. You should modify the datatype of the property or use string functions. IRISMYDEV>s obj = ##Class(CSVtoHL7.Inputfile.Record).%New() IRISMYDEV>s obj.DOB="12/12/1993" IRISMYDEV>zw ##Class(%Date).IsValid(obj.DOB) "0 "_$lb($lb(7207,"12/12/1993",,,,,,,,$lb(,"IRISMYDEV",$lb("e^IsValid+1^%Library.Date.1^1","e^^^0"))))/* ERROR #7207: Datatype value '12/12/1993' is not a valid number */ IRISMYDEV>w $SYSTEM.OBJ.DisplayError() ERROR #7207: Datatype value '12/12/1993' is not a valid number1 IRISMYDEV>s obj = ##Class(CSVtoHL7.Inputfile.Record).%New() IRISMYDEV>s obj.DOB=$ZDateH("12/12/1993") IRISMYDEV>zw ##Class(%Date).IsValid(obj.DOB) 1
go to post Ashok Kumar · Aug 21, 2023 Hello Pierre, No problem. You can use the merge command(sorry not a string function) to take a copy of entire global node and subtree merge queryparam = %request.Data zwrite queryparam ;print the entire node and subtree
go to post Ashok Kumar · Aug 20, 2023 Hello Pierre, You have two options to get query parameters You can merge the entire %request.Data into local array and use string function. User %request.Next(data) method to loop the %request.Data one by one and get query parameter values ClassMethod GetQueryParams() { set data="" For { set data = %request.Next(data) quit:data="" write data,! } } OUTPUT Bottom Name Top For cgiEnvs. You can follow same merge option to get all values. Otherwise use %request.NextCgiEnv(cgi) to get the list of available values. ClassMethod GetcgiEnvs() { set cgi="" for { set cgi = %request.NextCgiEnv(cgi) quit:cgi="" write cgi,! } }
go to post Ashok Kumar · Aug 11, 2023 Hi Pierre Can you try with below. And try Create a subclass of %CSP.SessionEvents and try override OnStartRequest, OnEndRequest . ClassMethod Page(skipheader As %Boolean = 1) As %Status [ ProcedureBlock = 0 ] { set ^Pierre("login")="on login (by overrided method Page)" return ##super(skipheader) }
go to post Ashok Kumar · Aug 11, 2023 Hello Pierre, You can Override the method OnPreDispatch from the %CSP.REST in your dispatcher class and capture your user connect information in application log. ClassMethod OnPreDispatch(pUrl As %String, pMethod As %String, ByRef pContinue As %Boolean) As %Status { set ^Pierre(pUrl)="" /// your implementation return $$$OK }
go to post Ashok Kumar · Aug 10, 2023 If you're receiving unexpected fields(key value pairs) as part of the JSON and the properties are not included in the class definition. You need to add the below parameter in your class definition(%JSON.Adaptor extended class). This will ignore loading the unexpected field. Parameter %JSONIGNOREINVALIDFIELD As BOOLEAN = 1 In addition, The JSON key-value pair data type should match with class definition property datatype.