Question
· Jan 27, 2021

Convert HL7 date with and without hours part

Hello,

We would need some help, please;

We would like to handle when we have a date with hours:

20201204090000

And when we have it without the hours part, as follows:

20201204

 

For the first case we used:

##class(Ens.Util.Time).ConvertDateTime(source.{ORCgrp(1).RXA:DateTimeStartofAdministratio},"%Y%m%d%H%M%S","%d/%m/%Y",,.tSC)

For the second one we wrote:

##class(Ens.Util.Time).ConvertDateTime(source.{ORCgrp(1).RXA:DateTimeStartofAdministratio},"%Y%m%d","%d/%m/%Y",,.tSC)

 

However each way only works for one case

 

How could we handle both cases with just a line of code?

 

We have read:

https://docs.intersystems.com/irislatest/csp/documatic/%25CSP.Documatic....

 

Thanks for your help

Discussion (1)1
Log in or sign up to continue