Data transformation
Hi Team,
I am trying to call Datetime in CUSTOM.Training.Functions class please refer the below line.
<assign value='##class(CUSTOM.Training.Functions).DateTime(source.{PIDgrpgrp().PIDgrp.PID:7.1})' property='target.{PID:7.1}' action='set' />
My Datetime method
ClassMethod DateTime(DateTime As %Integer)
{
Set Year = msg.SetValueAt(,"PIDgrpgrp().PIDgrp.PID:7.1","set")
Q Year
}
But i am not able to get the value of date of birth into the Datetime method, Kindly help how to get data of date of birth value into the method.
Thanks in advance
Product version: Ensemble 2018.1
$ZV: Cache for Windows (x86-64) 2018.1.1 (Build 312_1_18937U) Fri Apr 26 2019 17:58:36 EDT
If you're trying to get the 4 digit year from an HL7-formatted time string (YYYYmmddHHMM), your method should look like this (using GetYear rather than DateTime as method name for clarity):
You would then call that class as follows:
The variable Year should then contain the 4 digit year, or the empty string if the value in PID:7.1 is 4 characters or less.
I see two things here. First, in your Data Transformation, since PIDgrpgrp() repeats, you will need to specify a repetition in the parenthesis like PIDgrpgrp(1) for the first repetition.
Then, in your DateTime method, you will need to return the year. For example, if the DateTime was formatted YYYYMMDD:
Thank you for your help, now i can able to resolve my problem.