Last change
on this file since 507 was 507, checked in by George Lilly, 15 years ago |
NHIN gateway and adaptor for use on linux with VistA EHR and RPMS
|
File size:
946 bytes
|
Rev | Line | |
---|
[507] | 1 | /*
|
---|
| 2 | * To change this template, choose Tools | Templates
|
---|
| 3 | * and open the template in the editor.
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | package gov.hhs.fha.nhinc.patientcorrelationservice.parsers.helpers;
|
---|
| 7 |
|
---|
| 8 | import org.hl7.v3.TSExplicit;
|
---|
| 9 | import java.util.Calendar;
|
---|
| 10 | import java.text.SimpleDateFormat;
|
---|
| 11 | import java.util.Date;
|
---|
| 12 |
|
---|
| 13 | /**
|
---|
| 14 | *
|
---|
| 15 | * @author rayj
|
---|
| 16 | */
|
---|
| 17 | public class CreationTimeHelper {
|
---|
| 18 | public static final String DateFormat = "yyyyMMDDhhmmss";
|
---|
| 19 | public static TSExplicit getCreationTime() {
|
---|
| 20 | TSExplicit time = new TSExplicit();
|
---|
| 21 | String formattedTime;
|
---|
| 22 | try {
|
---|
| 23 | Calendar cal = Calendar.getInstance();
|
---|
| 24 | Date now = new Date();
|
---|
| 25 | String dateString = now.toString();
|
---|
| 26 | SimpleDateFormat sdf = new SimpleDateFormat(DateFormat);
|
---|
| 27 |
|
---|
| 28 | formattedTime = sdf.format(now);
|
---|
| 29 | time.setValue(formattedTime);
|
---|
| 30 | } catch (Exception ex) {
|
---|
| 31 | System.out.print(ex);
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | return time;
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.