Java Code Examples for ca.uhn.hl7v2.model.v24.datatype.TS

The following are top voted examples for showing how to use ca.uhn.hl7v2.model.v24.datatype.TS. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: openMAXIMS   File: VoMapper.java   Source Code and License 6 votes vote down vote up
/**
 * populateDateVoFromTS
 * <p>
 * Populates a Date class with values from TS YYYY[MM[DD[HHMM[SS[.S[S[S[S]]]]]]]][+/-
 * 
 * @param ts
 * @return ims.framework.utils.Date or null if partial date
 *         </p>
 * @throws Exception
 */
protected final DateTime populateDateTimeVoFromTS(TS ts) throws Exception
{
	LOG.debug("VoMapper populateDateTimeVoFromTS: entry");

	if (ts == null || ts.getTimeOfAnEvent().getValue() == null)
		return null;

	DateTime dt;
	String st = ts.getTimeOfAnEvent().getValue();
	if (st.length() < 12)
	{
		// Time is not included, so we will have to create a date and then instantiate a datetime
		// from that
		PartialDate pdt = new PartialDate(st);
		dt = new DateTime(pdt.toDate(), null);
	}
	else
		dt = new DateTime(st);
	if (dt != null)
		LOG.debug("VoMapper populateDateTimeVoFromTS: exit (" + dt.toString() + ")");
	return dt;
}
 
Example 2
Project: openMAXIMS   File: VoMapper.java   Source Code and License 6 votes vote down vote up
/**
 * populateDateVoFromTS
 * <p>
 * Populates a Date class with values from TS YYYY[MM[DD[HHMM[SS[.S[S[S[S]]]]]]]][+/-
 * 
 * @param ts
 * @return ims.framework.utils.Date or null if partial date
 *         </p>
 * @throws Exception
 */
protected final DateTime populateDateTimeVoFromTS(TS ts) throws Exception
{
	LOG.debug("VoMapper populateDateTimeVoFromTS: entry");

	if (ts == null || ts.getTimeOfAnEvent().getValue() == null)
		return null;

	DateTime dt;
	String st = ts.getTimeOfAnEvent().getValue();
	if (st.length() < 12)
	{
		// Time is not included, so we will have to create a date and then instantiate a datetime
		// from that
		PartialDate pdt = new PartialDate(st);
		dt = new DateTime(pdt.toDate(), null);
	}
	else
		dt = new DateTime(st);
	if (dt != null)
		LOG.debug("VoMapper populateDateTimeVoFromTS: exit (" + dt.toString() + ")");
	return dt;
}
 
Example 3
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 6 votes vote down vote up
/**
 * populateDateVoFromTS
 * <p>
 * Populates a Date class with values from TS YYYY[MM[DD[HHMM[SS[.S[S[S[S]]]]]]]][+/-
 * 
 * @param ts
 * @return ims.framework.utils.Date or null if partial date
 *         </p>
 * @throws Exception
 */
protected final DateTime populateDateTimeVoFromTS(TS ts) throws Exception
{
	LOG.debug("VoMapper populateDateTimeVoFromTS: entry");

	if (ts == null || ts.getTimeOfAnEvent().getValue() == null)
		return null;

	DateTime dt;
	String st = ts.getTimeOfAnEvent().getValue();
	if (st.length() < 12)
	{
		// Time is not included, so we will have to create a date and then instantiate a datetime
		// from that
		PartialDate pdt = new PartialDate(st);
		dt = new DateTime(pdt.toDate(), null);
	}
	else
		dt = new DateTime(st);
	if (dt != null)
		LOG.debug("VoMapper populateDateTimeVoFromTS: exit (" + dt.toString() + ")");
	return dt;
}
 
Example 4
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
/**
 * populateDateVoFromTS
 * <p>
 * Populates a Date class with values from TS YYYY[MM[DD[HHMM[SS[.S[S[S[S]]]]]]]][+/-
 * 
 * @param ts
 * @return ims.framework.utils.Date or null if partial date
 *         </p>
 */
protected final Date populateDateVoFromTS(TS ts)
{
	LOG.debug("VoMapper populateDateVoFromTS: entry");

	if (ts == null || ts.getTimeOfAnEvent().getValue() == null)
		return null;
	Date dt = null;
	String st = ts.getTimeOfAnEvent().getValue();
	PartialDate pdt = new PartialDate(st);
	dt = pdt.toDate();
	if (dt != null)
		LOG.debug("VoMapper populateDateVoFromTS: exit (" + dt.toString() + ")");
	return dt;
}
 
Example 5
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final void renderDateTimeVoToTS(DateTime dt, TS ts) throws Exception
{
	LOG.debug("VoMapper renderDateTimeVoToTS: entry");
	if (dt == null)
		return;

	ts.getTimeOfAnEvent().setValue(dt.toString(DateTimeFormat.MILLI));

	LOG.debug("VoMapper renderDateTimeVoToTS: exit (" + ts.toString() + ")");
}
 
Example 6
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final void renderDateVoToTS(Date dt, TS ts) throws Exception
{
	LOG.debug("VoMapper renderDateVoToTS: entry");
	if (dt == null)
		return;

	ts.getTimeOfAnEvent().setValue(dt.toString(DateFormat.ISO));
	LOG.debug("VoMapper renderDateVoToTS: exit (" + ts.toString() + ")");
}
 
Example 7
Project: AvoinApotti   File: RefManHL7Helper.java   Source Code and License 5 votes vote down vote up
final void renderDateTimeVoToTS(DateTime dt, TS ts) throws DataTypeException 
{
	LOG.debug("VoMapper renderDateTimeVoToTS: entry");
	if (dt == null)
		return;

	ts.getTimeOfAnEvent().setValue(dt.toString(DateTimeFormat.MILLI));

	LOG.debug("VoMapper renderDateTimeVoToTS: exit (" + ts.toString() + ")");
}
 
Example 8
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
/**
 * populateDateVoFromTS
 * <p>
 * Populates a Date class with values from TS YYYY[MM[DD[HHMM[SS[.S[S[S[S]]]]]]]][+/-
 * 
 * @param ts
 * @return ims.framework.utils.Date or null if partial date
 *         </p>
 */
protected final Date populateDateVoFromTS(TS ts)
{
	LOG.debug("VoMapper populateDateVoFromTS: entry");

	if (ts == null || ts.getTimeOfAnEvent().getValue() == null)
		return null;
	Date dt = null;
	String st = ts.getTimeOfAnEvent().getValue();
	PartialDate pdt = new PartialDate(st);
	dt = pdt.toDate();
	if (dt != null)
		LOG.debug("VoMapper populateDateVoFromTS: exit (" + dt.toString() + ")");
	return dt;
}
 
Example 9
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final void renderDateTimeVoToTS(DateTime dt, TS ts) throws Exception
{
	LOG.debug("VoMapper renderDateTimeVoToTS: entry");
	if (dt == null)
		return;

	ts.getTimeOfAnEvent().setValue(dt.toString(DateTimeFormat.MILLI));

	LOG.debug("VoMapper renderDateTimeVoToTS: exit (" + ts.toString() + ")");
}
 
Example 10
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final void renderDateTimeVoToTS(DateTime dt, TS ts,DateTimeFormat format) throws Exception
{
	LOG.debug("VoMapper renderDateTimeVoToTS: entry");
	if (dt == null)
		return;

	ts.getTimeOfAnEvent().setValue(dt.toString(format));

	LOG.debug("VoMapper renderDateTimeVoToTS: exit (" + ts.toString() + ")");
}
 
Example 11
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final void renderDateVoToTS(Date dt, TS ts) throws Exception
{
	LOG.debug("VoMapper renderDateVoToTS: entry");
	if (dt == null)
		return;

	ts.getTimeOfAnEvent().setValue(dt.toString(DateFormat.ISO));
	LOG.debug("VoMapper renderDateVoToTS: exit (" + ts.toString() + ")");
}
 
Example 12
Project: openMAXIMS   File: RefManHL7Helper.java   Source Code and License 5 votes vote down vote up
final void renderDateTimeVoToTS(DateTime dt, TS ts) throws DataTypeException 
{
	LOG.debug("VoMapper renderDateTimeVoToTS: entry");
	if (dt == null)
		return;

	ts.getTimeOfAnEvent().setValue(dt.toString(DateTimeFormat.MILLI));

	LOG.debug("VoMapper renderDateTimeVoToTS: exit (" + ts.toString() + ")");
}
 
Example 13
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
/**
 * populateDateVoFromTS
 * <p>
 * Populates a Date class with values from TS YYYY[MM[DD[HHMM[SS[.S[S[S[S]]]]]]]][+/-
 * 
 * @param ts
 * @return ims.framework.utils.Date or null if partial date
 *         </p>
 */
protected final Date populateDateVoFromTS(TS ts)
{
	LOG.debug("VoMapper populateDateVoFromTS: entry");

	if (ts == null || ts.getTimeOfAnEvent().getValue() == null)
		return null;
	Date dt = null;
	String st = ts.getTimeOfAnEvent().getValue();
	PartialDate pdt = new PartialDate(st);
	dt = pdt.toDate();
	if (dt != null)
		LOG.debug("VoMapper populateDateVoFromTS: exit (" + dt.toString() + ")");
	return dt;
}
 
Example 14
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final void renderDateTimeVoToTS(DateTime dt, TS ts) throws Exception
{
	LOG.debug("VoMapper renderDateTimeVoToTS: entry");
	if (dt == null)
		return;

	ts.getTimeOfAnEvent().setValue(dt.toString(DateTimeFormat.MILLI));

	LOG.debug("VoMapper renderDateTimeVoToTS: exit (" + ts.toString() + ")");
}
 
Example 15
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final void renderDateVoToTS(Date dt, TS ts) throws Exception
{
	LOG.debug("VoMapper renderDateVoToTS: entry");
	if (dt == null)
		return;

	ts.getTimeOfAnEvent().setValue(dt.toString(DateFormat.ISO));
	LOG.debug("VoMapper renderDateVoToTS: exit (" + ts.toString() + ")");
}
 
Example 16
Project: openMAXIMS   File: RefManHL7Helper.java   Source Code and License 5 votes vote down vote up
final void renderDateTimeVoToTS(DateTime dt, TS ts) throws DataTypeException 
{
	LOG.debug("VoMapper renderDateTimeVoToTS: entry");
	if (dt == null)
		return;

	ts.getTimeOfAnEvent().setValue(dt.toString(DateTimeFormat.MILLI));

	LOG.debug("VoMapper renderDateTimeVoToTS: exit (" + ts.toString() + ")");
}
 
Example 17
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 5 votes vote down vote up
/**
 * populateDateVoFromTS
 * <p>
 * Populates a Date class with values from TS YYYY[MM[DD[HHMM[SS[.S[S[S[S]]]]]]]][+/-
 * 
 * @param ts
 * @return ims.framework.utils.Date or null if partial date
 *         </p>
 */
protected final Date populateDateVoFromTS(TS ts)
{
	LOG.debug("VoMapper populateDateVoFromTS: entry");

	if (ts == null || ts.getTimeOfAnEvent().getValue() == null)
		return null;
	Date dt = null;
	String st = ts.getTimeOfAnEvent().getValue();
	PartialDate pdt = new PartialDate(st);
	dt = pdt.toDate();
	if (dt != null)
		LOG.debug("VoMapper populateDateVoFromTS: exit (" + dt.toString() + ")");
	return dt;
}
 
Example 18
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final void renderDateTimeVoToTS(DateTime dt, TS ts) throws Exception
{
	LOG.debug("VoMapper renderDateTimeVoToTS: entry");
	if (dt == null)
		return;

	ts.getTimeOfAnEvent().setValue(dt.toString(DateTimeFormat.MILLI));

	LOG.debug("VoMapper renderDateTimeVoToTS: exit (" + ts.toString() + ")");
}
 
Example 19
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final void renderDateVoToTS(Date dt, TS ts) throws Exception
{
	LOG.debug("VoMapper renderDateVoToTS: entry");
	if (dt == null)
		return;

	ts.getTimeOfAnEvent().setValue(dt.toString(DateFormat.ISO));
	LOG.debug("VoMapper renderDateVoToTS: exit (" + ts.toString() + ")");
}
 
Example 20
Project: rassyeyanie   File: SymA08PimsA08.java   Source Code and License 5 votes vote down vote up
private void transformZref(Segment zref, PV1 pv1)
    throws DataTypeException, HL7Exception
{
    
    CE referralType = new CE(pv1.getMessage());
    ((Varies) zref.getField(1, 0)).setData(referralType);
    referralType.getCe1_Identifier().setValue("EMERG");
    referralType.getCe3_NameOfCodingSystem().clear();
    
    TS dateReceived = new TS(pv1.getMessage());
    ((Varies) zref.getField(2, 0)).setData(dateReceived);
    dateReceived.getTs1_TimeOfAnEvent().setValue(
        pv1.getPv144_AdmitDateTime().getTs1_TimeOfAnEvent().getValue());
    
    for (int i = 3; i <= 14; i++)
    {
        zref.getField(i, 0).clear();
    }
    
    CE referralSource = new CE(pv1.getMessage());
    ((Varies) zref.getField(5, 0)).setData(referralSource);
    referralSource.getCe1_Identifier().clear();
    referralSource.getCe3_NameOfCodingSystem().setValue("DGATE");
    
    CE priority = new CE(pv1.getMessage());
    ((Varies) zref.getField(11, 0)).setData(priority);
    priority.getCe1_Identifier().setValue("R");
    
    CE qual = new CE(pv1.getMessage());
    ((Varies) zref.getField(12, 0)).setData(qual);
    qual.clear();
    
}
 
Example 21
Project: AvoinApotti   File: R01NasMapper.java   Source Code and License 4 votes vote down vote up
private ImsNasMsg makeOCS_COMPSMsg(OBX obx, int seqNo, String msgSrcId) throws Exception
{
	ImsNasMsg nm = new ImsNasMsg();
	
	nm.addPair("*SERVICE","OCS_COMPS");
	nm.addPair("ACTION","INSERT");		
	nm.addPair("RES_COMP_ID","");
	nm.addPair("RES_ID","");
	nm.addPair("RES_COMP_SEQ",""+seqNo+1);
	nm.addPair("RES_CD","");
	nm.addPair("RES_EXT_CD",obx.getObservationIdentifier().getIdentifier().getValue());
	String resVal = HL7Utils.getValueFromVariant(obx.getObservationValue(0),0);
	String valType = obx.getValueType().getValue();
	if (valType.equals("CE"))
		valType = "NM"; //JME Mar 2006
	nm.addPair("RES_VAL_TYPE",valType);
	if(valType.equals("FT") || valType.equals("TX"))
	{
		nm.addPair("RES_VAL","");
		nm.addPairs(getTextInfo(resVal,"TXT_SEQNO","RES_TEXT",null,0));
	}
	else
		nm.addPair("RES_VAL",resVal);
	
	nm.addPair("UNIT_OF_MEASURE",obx.getUnits().getText().getValue());
	nm.addPair("REF_RANGE",obx.getReferencesRange().getValue());
	nm.addPair("ABNORMAL_FLAG",obx.getAbnormalFlags().getValue());
	nm.addPair("RES_STAT","F");

	TS ts = obx.getDateTimeOfTheObservation();
	String dt;
	
	if (ts != null && (dt = ts.getTimeOfAnEvent().getValue()) != null)
	{			
		nm.addPair("DATE_OF_OBS",getDateTime(dt,DATE));
		nm.addPair("TIME_OF_OBS",getDateTime(dt,TIME));		
	}
	nm.addPair("RES_EXT_NAME",obx.getObservationIdentifier().getText().getValue());
	nm.addPair("RES_NAME",obx.getObservationIdentifier().getText().getValue());
	nm.addPair("COMP_MSG_SRC_ID",msgSrcId); //config flags?
	
	return nm;

}
 
Example 22
Project: AvoinApotti   File: VoMapper.java   Source Code and License 4 votes vote down vote up
protected final boolean isTimeSupplied(TS ts)
{
	if (ts == null || ts.getTimeOfAnEvent().getValue() == null)
		return false;		
	return ts.getTimeOfAnEvent().getValue().length() >= 12;
}
 
Example 23
Project: openMAXIMS   File: R01NasMapper.java   Source Code and License 4 votes vote down vote up
private ImsNasMsg makeOCS_COMPSMsg(OBX obx, int seqNo, String msgSrcId) throws Exception
{
	ImsNasMsg nm = new ImsNasMsg();
	
	nm.addPair("*SERVICE","OCS_COMPS");
	nm.addPair("ACTION","INSERT");		
	nm.addPair("RES_COMP_ID","");
	nm.addPair("RES_ID","");
	nm.addPair("RES_COMP_SEQ",""+seqNo+1);
	nm.addPair("RES_CD","");
	nm.addPair("RES_EXT_CD",obx.getObservationIdentifier().getIdentifier().getValue());
	String resVal = HL7Utils.getValueFromVariant(obx.getObservationValue(0),0);
	String valType = obx.getValueType().getValue();
	if (valType.equals("CE"))
		valType = "NM"; //JME Mar 2006
	nm.addPair("RES_VAL_TYPE",valType);
	if(valType.equals("FT") || valType.equals("TX"))
	{
		nm.addPair("RES_VAL","");
		nm.addPairs(getTextInfo(resVal,"TXT_SEQNO","RES_TEXT",null,0));
	}
	else
		nm.addPair("RES_VAL",resVal);
	
	nm.addPair("UNIT_OF_MEASURE",obx.getUnits().getText().getValue());
	nm.addPair("REF_RANGE",obx.getReferencesRange().getValue());
	nm.addPair("ABNORMAL_FLAG",obx.getAbnormalFlags().getValue());
	nm.addPair("RES_STAT","F");

	TS ts = obx.getDateTimeOfTheObservation();
	String dt;
	
	if (ts != null && (dt = ts.getTimeOfAnEvent().getValue()) != null)
	{			
		nm.addPair("DATE_OF_OBS",getDateTime(dt,DATE));
		nm.addPair("TIME_OF_OBS",getDateTime(dt,TIME));		
	}
	nm.addPair("RES_EXT_NAME",obx.getObservationIdentifier().getText().getValue());
	nm.addPair("RES_NAME",obx.getObservationIdentifier().getText().getValue());
	nm.addPair("COMP_MSG_SRC_ID",msgSrcId); //config flags?
	
	return nm;

}
 
Example 24
Project: openMAXIMS   File: VoMapper.java   Source Code and License 4 votes vote down vote up
protected final boolean isTimeSupplied(TS ts)
{
	if (ts == null || ts.getTimeOfAnEvent().getValue() == null)
		return false;		
	return ts.getTimeOfAnEvent().getValue().length() >= 12;
}
 
Example 25
Project: openMAXIMS   File: R01NasMapper.java   Source Code and License 4 votes vote down vote up
private ImsNasMsg makeOCS_COMPSMsg(OBX obx, int seqNo, String msgSrcId) throws Exception
{
	ImsNasMsg nm = new ImsNasMsg();
	
	nm.addPair("*SERVICE","OCS_COMPS");
	nm.addPair("ACTION","INSERT");		
	nm.addPair("RES_COMP_ID","");
	nm.addPair("RES_ID","");
	nm.addPair("RES_COMP_SEQ",""+seqNo+1);
	nm.addPair("RES_CD","");
	nm.addPair("RES_EXT_CD",obx.getObservationIdentifier().getIdentifier().getValue());
	String resVal = HL7Utils.getValueFromVariant(obx.getObservationValue(0),0);
	String valType = obx.getValueType().getValue();
	if (valType.equals("CE"))
		valType = "NM"; //JME Mar 2006
	nm.addPair("RES_VAL_TYPE",valType);
	if(valType.equals("FT") || valType.equals("TX"))
	{
		nm.addPair("RES_VAL","");
		nm.addPairs(getTextInfo(resVal,"TXT_SEQNO","RES_TEXT",null,0));
	}
	else
		nm.addPair("RES_VAL",resVal);
	
	nm.addPair("UNIT_OF_MEASURE",obx.getUnits().getText().getValue());
	nm.addPair("REF_RANGE",obx.getReferencesRange().getValue());
	nm.addPair("ABNORMAL_FLAG",obx.getAbnormalFlags().getValue());
	nm.addPair("RES_STAT","F");

	TS ts = obx.getDateTimeOfTheObservation();
	String dt;
	
	if (ts != null && (dt = ts.getTimeOfAnEvent().getValue()) != null)
	{			
		nm.addPair("DATE_OF_OBS",getDateTime(dt,DATE));
		nm.addPair("TIME_OF_OBS",getDateTime(dt,TIME));		
	}
	nm.addPair("RES_EXT_NAME",obx.getObservationIdentifier().getText().getValue());
	nm.addPair("RES_NAME",obx.getObservationIdentifier().getText().getValue());
	nm.addPair("COMP_MSG_SRC_ID",msgSrcId); //config flags?
	
	return nm;

}
 
Example 26
Project: openMAXIMS   File: VoMapper.java   Source Code and License 4 votes vote down vote up
protected final boolean isTimeSupplied(TS ts)
{
	if (ts == null || ts.getTimeOfAnEvent().getValue() == null)
		return false;		
	return ts.getTimeOfAnEvent().getValue().length() >= 12;
}
 
Example 27
Project: openmaxims-linux   File: R01NasMapper.java   Source Code and License 4 votes vote down vote up
private ImsNasMsg makeOCS_COMPSMsg(OBX obx, int seqNo, String msgSrcId) throws Exception
{
	ImsNasMsg nm = new ImsNasMsg();
	
	nm.addPair("*SERVICE","OCS_COMPS");
	nm.addPair("ACTION","INSERT");		
	nm.addPair("RES_COMP_ID","");
	nm.addPair("RES_ID","");
	nm.addPair("RES_COMP_SEQ",""+seqNo+1);
	nm.addPair("RES_CD","");
	nm.addPair("RES_EXT_CD",obx.getObservationIdentifier().getIdentifier().getValue());
	String resVal = HL7Utils.getValueFromVariant(obx.getObservationValue(0),0);
	String valType = obx.getValueType().getValue();
	if (valType.equals("CE"))
		valType = "NM"; //JME Mar 2006
	nm.addPair("RES_VAL_TYPE",valType);
	if(valType.equals("FT") || valType.equals("TX"))
	{
		nm.addPair("RES_VAL","");
		nm.addPairs(getTextInfo(resVal,"TXT_SEQNO","RES_TEXT",null,0));
	}
	else
		nm.addPair("RES_VAL",resVal);
	
	nm.addPair("UNIT_OF_MEASURE",obx.getUnits().getText().getValue());
	nm.addPair("REF_RANGE",obx.getReferencesRange().getValue());
	nm.addPair("ABNORMAL_FLAG",obx.getAbnormalFlags().getValue());
	nm.addPair("RES_STAT","F");

	TS ts = obx.getDateTimeOfTheObservation();
	String dt;
	
	if (ts != null && (dt = ts.getTimeOfAnEvent().getValue()) != null)
	{			
		nm.addPair("DATE_OF_OBS",getDateTime(dt,DATE));
		nm.addPair("TIME_OF_OBS",getDateTime(dt,TIME));		
	}
	nm.addPair("RES_EXT_NAME",obx.getObservationIdentifier().getText().getValue());
	nm.addPair("RES_NAME",obx.getObservationIdentifier().getText().getValue());
	nm.addPair("COMP_MSG_SRC_ID",msgSrcId); //config flags?
	
	return nm;

}
 
Example 28
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 4 votes vote down vote up
protected final boolean isTimeSupplied(TS ts)
{
	if (ts == null || ts.getTimeOfAnEvent().getValue() == null)
		return false;		
	return ts.getTimeOfAnEvent().getValue().length() >= 12;
}
 
Example 29
Project: rassyeyanie   File: SymA03PimsA03.java   Source Code and License 4 votes vote down vote up
private void transformZref(Segment zref, PV1 pv1)
    throws DataTypeException, HL7Exception
{
    CE referralType = new CE(pv1.getMessage());
    ((Varies) zref.getField(1, 0)).setData(referralType);
    referralType.getCe1_Identifier().setValue("EMERG");
    referralType.getCe3_NameOfCodingSystem().setValue("DGATE");
    
    TS dateReceived = new TS(pv1.getMessage());
    ((Varies) zref.getField(2, 0)).setData(dateReceived);
    dateReceived.getTs1_TimeOfAnEvent().setValue(
        pv1.getPv144_AdmitDateTime().getTs1_TimeOfAnEvent().getValue());
    
    for (int i = 3; i <= 4; i++)
    {
        zref.getField(i, 0).clear();
    }
    
    CE referralSource = new CE(pv1.getMessage());
    ((Varies) zref.getField(5, 0)).setData(referralSource);
    referralSource.getCe1_Identifier().clear();
    referralSource.getCe3_NameOfCodingSystem().setValue("DGATE");
    
    XCN referredBy = new XCN(pv1.getMessage());
    ((Varies) zref.getField(6, 0)).setData(referredBy);
    referredBy.getXcn1_IDNumber().setValue("EDCDU");
    referredBy.getXcn3_GivenName().setValue("DGATE");
    
    XCN referredTo = new XCN(pv1.getMessage());
    ((Varies) zref.getField(7, 0)).setData(referredTo);
    referredTo.getXcn3_GivenName().setValue("DGATE");
    
    CE referralBySpecialty = new CE(pv1.getMessage());
    ((Varies) zref.getField(9, 0)).setData(referralBySpecialty);
    referralBySpecialty.getCe3_NameOfCodingSystem().setValue("DGATE");
    
    CE referralByOrg = new CE(pv1.getMessage());
    ((Varies) zref.getField(8, 0)).setData(referralByOrg);
    referralByOrg.getCe1_Identifier().setValue(
        referralBySpecialty.getCe1_Identifier().getValue());
    referralByOrg.getCe3_NameOfCodingSystem().setValue("DGATE");
    
    CE priority = new CE(pv1.getMessage());
    ((Varies) zref.getField(11, 0)).setData(priority);
    priority.getCe1_Identifier().setValue("R");
    
    zref.getField(12, 0).clear();
}