Does anyone have a function that takes a date format that drops the leading zeros and formats it in a 10-digit date format?
We are going to start using the Immunization HTML form, and I need to create visibilities based on the patients last vaccine date. But the delimited list from IMMUN_GETLIST() drops the leading zeros. Why would they do that??
1753027034385120^1753027034385120^Influenza^Flulaval Intramuscular Injectable^Flulaval Intramuscular Injectable^1^Y^^N^^V01^125152^^17100020202200^^54569641800^141^0.5^mL^IM^C28161^Left Deltoid^LD^GlaxoSmithKline^OTH^123654^6/7/2016^8/19/2014^kblake^7/20/2015 3:57 PM^D^^^^^^Y^kblake^7/20/2015 3:57 PM^^^^0^
Thanks!
I do not have a function, but all of the date fields in MEL code (ADDDATES,DURATIONDAYS,SUBTRACTDATES) work without the leading zeros. I just tested it with the dates you posted in your code and it calculated just fine, so you should be able to use it for visibility fields no problem.
Building on dcarpenter's response, if you plug it in to Adddates and add 0 it will return the ten digit date, for example -
adddates("7/3/2015","0","0","0")
returns
"07/03/2015"
Its the same way I test for a valid date, and invalid date will return blank, a valid date returns the same date.
I pull field 30 with and run it through this sub(str(rtnvalue1),1,10) it gets rid of the time and just use the date and makes it a string. rtnvalue1 is the field 30 from the array.
Then to do your comparisons just something like this DurationDays(str(date from imms),str("09/01/2015")) > 365
If I understand your question this should work.
Cecil
Hello Cecil,
What do you mean by running field 30 through this sub(str(rtnvalue1),1,10)? What would this look like?
Thanks,
Carolyn
[email protected]
This will take a date field with time and strip the time off. It takes the first 10 characters of the field.
Cecil