Java Code Examples for ca.uhn.hl7v2.model.Varies

The following are top voted examples for showing how to use ca.uhn.hl7v2.model.Varies. 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: OHP-M2M   File: PCD01.java   Source Code and License 6 votes vote down vote up
private void SetOBX10408(String val_bodyTemp) throws HL7Exception, IOException{
	OBX segOBX = m_Observation.getOBX();
	Varies value = segOBX.getObservationValue(0);
	
	/*-- Body temperature observation result ------------------------------------------------------*/
	segOBX.getSetIDOBX().setValue("1");
	segOBX.getValueType().setValue("NM");
	segOBX.getObservationSubID().setValue("1");
	segOBX.getObservationIdentifier().getCwe1_Identifier().setValue("19292");
	segOBX.getObservationIdentifier().getCwe2_Text().setValue("MDC_TEMP_BODY");
	segOBX.getObservationIdentifier().getCwe3_NameOfCodingSystem().setValue("MDC");
	
	NM bodyTemp = new NM(m_Msg);
	bodyTemp.setValue(val_bodyTemp);
       value.setData(bodyTemp);
       
       segOBX.getUnits().getCwe1_Identifier().setValue("262688");
       segOBX.getUnits().getCwe2_Text().setValue("MDC_DIM_DEGC");
       segOBX.getUnits().getCwe3_NameOfCodingSystem().setValue("MDC");
}
 
Example 2
Project: t5-doc   File: PCD_01MessageToXMLConverter.java   Source Code and License 5 votes vote down vote up
private void handleObservation(ORU_R01_OBSERVATION observation, Document doc, Element elemObsOrders,
		Element elemOrder, DTM orderDateTime, String serviceID_id, Map<String, Element> mapMDS,
		Map<String, Element> mapVMD, Map<String, Element> mapCHAN, Map<String, Element> mapMetric)
		throws HL7Exception, DataTypeException, XPathExpressionException {
	OBX obx = observation.getOBX();

	// Attributes of Observation itself - from OBX segment
	Element elemObs = doc.createElement("Observation");
	elemObsOrders.appendChild(elemObs);

	// Observation UID based on generated GUID
	String guidObs = UUID.randomUUID().toString();
	elemObs.setAttribute("uid", guidObs);

	Element elemObsIdentifier = createObsIdentifierElement(doc, obx);
	elemObs.appendChild(elemObsIdentifier);

	handleAlternativeIdentifiers(doc, obx, elemObs, elemObsIdentifier);

	handleHierarchy(doc, elemObsOrders, elemOrder, serviceID_id, obx, elemObs, obx.getObservationSubID()
			.getValueOrEmpty(), mapMDS, mapVMD, mapCHAN, mapMetric);

	// OBX-2 setid
	elemObs.setAttribute("setid", obx.getObx1_SetIDOBX().getValue());

	// May be multiple values
	for (Varies value : obx.getObservationValue()) {
		elemObs.appendChild(createValueElement(doc, obx, value));
	}

	// Unit
	CWE units = obx.getObx6_Units();
	if (!units.getCwe1_Identifier().isEmpty()) {
		elemObs.appendChild(createUnitElement(doc, units));
	}

	elemObs.appendChild(createTimestampElement(doc, orderDateTime, obx, elemObs));

	createEquipmentIdentifiers(doc, obx, elemObs);
}
 
Example 3
Project: OHP-M2M   File: PCD01.java   Source Code and License 5 votes vote down vote up
private void SetOBX10404(String val_spo2, String val_pulserate) throws HL7Exception, IOException{
	OBX segOBX = m_Observation.getOBX();
	Varies value = segOBX.getObservationValue(0);
	
	/*-- spo2 -------------------------------------------------------------------------------*/
	segOBX.getSetIDOBX().setValue("1");
	segOBX.getValueType().setValue("NM");
	segOBX.getObservationSubID().setValue("1");
	segOBX.getObservationIdentifier().getCwe1_Identifier().setValue("19384");
	segOBX.getObservationIdentifier().getCwe2_Text().setValue("MDC_PULS_OXIM_SAT_02");
	segOBX.getObservationIdentifier().getCwe3_NameOfCodingSystem().setValue("MDC");
	
	NM spo2 = new NM(m_Msg);
       spo2.setValue(val_spo2);
       value.setData(spo2);
       
       segOBX.getUnits().getCwe1_Identifier().setValue("262688");
       segOBX.getUnits().getCwe2_Text().setValue("MDC_DIM_PERCENT");
       segOBX.getUnits().getCwe3_NameOfCodingSystem().setValue("MDC");
       
       /*-- Pulse rate -------------------------------------------------------------------------*/
       segOBX = m_OrderObservation.getOBSERVATION(1).getOBX();
       segOBX.getSetIDOBX().setValue("2");
       segOBX.getValueType().setValue("NM");
       segOBX.getObservationSubID().setValue("1");
       segOBX.getObservationIdentifier().getCwe1_Identifier().setValue("18458");
       segOBX.getObservationIdentifier().getCwe2_Text().setValue("MDC_PULS_OXIM_PULS_RATE");
       segOBX.getObservationIdentifier().getCwe3_NameOfCodingSystem().setValue("MDC");
       
       NM pulserate = new NM(m_Msg);
       pulserate.setValue(val_pulserate);
       value = segOBX.getObservationValue(0);
       value.setData(pulserate);
       
       segOBX.getUnits().getCwe1_Identifier().setValue("262688");
       segOBX.getUnits().getCwe2_Text().setValue("MDC_DIM_PERCENT");
       segOBX.getUnits().getCwe3_NameOfCodingSystem().setValue("MDC");
}
 
Example 4
Project: OHP-M2M   File: PCD01.java   Source Code and License 5 votes vote down vote up
private void SetOBX10407(String val_bldprs, String val_pulserate) throws HL7Exception, IOException{
	OBX segOBX = m_Observation.getOBX();
	Varies value = segOBX.getObservationValue(0);
	
	/*-- Systolic | diastolic | MAP compound observation result -----------------------------------*/
	segOBX.getSetIDOBX().setValue("1");
	segOBX.getValueType().setValue("NM");
	segOBX.getObservationSubID().setValue("1");
	segOBX.getObservationIdentifier().getCwe1_Identifier().setValue("18948");
	segOBX.getObservationIdentifier().getCwe2_Text().setValue("MDC_PRESS_BLD_NONINV");
	segOBX.getObservationIdentifier().getCwe3_NameOfCodingSystem().setValue("MDC");
	
	NM bldprs = new NM(m_Msg);
	bldprs.setValue(val_bldprs);
       value.setData(bldprs);
       
       segOBX.getUnits().getCwe1_Identifier().setValue("262688");
       segOBX.getUnits().getCwe2_Text().setValue("MDC_DIM_MMHG");
       segOBX.getUnits().getCwe3_NameOfCodingSystem().setValue("MDC");
       
       /*-- pulse rate observation result ------------------------------------------------------------*/
       segOBX = m_OrderObservation.getOBSERVATION(1).getOBX();
       segOBX.getSetIDOBX().setValue("2");
       segOBX.getValueType().setValue("NM");
       segOBX.getObservationSubID().setValue("1");
       segOBX.getObservationIdentifier().getCwe1_Identifier().setValue("18458");
       segOBX.getObservationIdentifier().getCwe2_Text().setValue("MDC_PULS_OXIM_PULS_RATE");
       segOBX.getObservationIdentifier().getCwe3_NameOfCodingSystem().setValue("MDC");
       
       NM pulserate = new NM(m_Msg);
       pulserate.setValue(val_pulserate);
       value = segOBX.getObservationValue(0);
       value.setData(pulserate);
       
       segOBX.getUnits().getCwe1_Identifier().setValue("262688");
       segOBX.getUnits().getCwe2_Text().setValue("MDC_DIM_PERCENT");
       segOBX.getUnits().getCwe3_NameOfCodingSystem().setValue("MDC");
}
 
Example 5
Project: rassyeyanie   File: ObxDataFormat.java   Source Code and License 5 votes vote down vote up
@Override
public void process(Exchange exchange)
    throws Exception
{
    // System.setProperty(Varies.INVALID_OBX2_TYPE_PROP, "ST");
    System.setProperty(Varies.DEFAULT_OBX2_TYPE_PROP, "TX");
    
    message = exchange.getIn().getBody(String.class);
    
    if (StringUtils.contains(message, "OBX|"))
    {
        this.output = message;
        for (numberOfObx = 0; numberOfObx <= (StringUtils.countMatches(
            message,
            "OBX|")); numberOfObx++)
        {
            
            if (message.contains("OBX|" + numberOfObx + "||"))
                this.output =
                    StringUtils.defaultString(output.replace(
                        "OBX|" + numberOfObx + "||",
                        "OBX|" + numberOfObx + "|TX|"));
        }
        
        exchange.getIn().setBody(this.output);
    }
    // exchange.getIn().setBody(this.output);
}
 
Example 6
Project: rassyeyanie   File: SymA02PimsA01.java   Source Code and License 5 votes vote down vote up
private void transformZref(Segment zref)
    throws HL7Exception
{
    CE ce = new CE(zref.getMessage());
    ((Varies) zref.getField(1, 0)).setData(ce);
    ce.getCe1_Identifier().setValue("EMERG");
    
    ce.getCe3_NameOfCodingSystem().setValue("DGATE");
}
 
Example 7
Project: rassyeyanie   File: SymA02PimsA01.java   Source Code and License 5 votes vote down vote up
private void transform(PV1 pv1, Segment zref, EVN evn)
    throws HL7Exception
{
    pv1.getPv12_PatientClass().setValue("I");
    for (int i = 6; i < 9; i++)
        pv1.getField(i, 0).clear();
    pv1
        .getPv19_ConsultingDoctor(0)
        .getXcn1_IDNumber()
        .setValue(zref.getField(7, 0).encode().split("\\^")[0]);
    pv1.getPv110_HospitalService().setValue(
        zref.getField(9, 0).encode().split("\\^")[0]);
    pv1.getPv122_CourtesyCode().setValue("NSP");
    pv1.getPv128_InterestCode().setValue("NSP");
    zref.getField(2, 0).parse(
        pv1.getPv144_AdmitDateTime().getTs1_TimeOfAnEvent().getValue());
    pv1
        .getPv144_AdmitDateTime()
        .getTs1_TimeOfAnEvent()
        .setValueToSecond(
            evn
                .getEvn2_RecordedDateTime()
                .getTimeOfAnEvent()
                .getValueAsCalendar());
    pv1.getPv150_AlternateVisitID().clear();
    
    zref.getField(5, 0).parse(zref.getField(5, 0).encode() + "^^DGATE");
    zref.getField(8, 0).parse(zref.getField(9, 0).encode());
    zref.getField(11, 0).parse("R^^DGATE");
    ((Varies) zref.getField(12, 0)).setData(new ST(zref.getMessage()));
    zref.getField(12, 0).clear();
}
 
Example 8
Project: rassyeyanie   File: SymA13PimsA11.java   Source Code and License 5 votes vote down vote up
private void transformZrf(Segment zrf, PV1 pv1)
    throws HL7Exception
{
    zrf.getField(1, 0).parse("EMERG^^DGATE");
    zrf.getField(2, 0).parse(
        pv1.getPv144_AdmitDateTime().getTimeOfAnEvent().getValue());
    
    ((Varies) zrf.getField(5, 0)).setData(new XCN(zrf.getMessage()));
    zrf.getField(5, 0).parse("^^DGATE");
    
    zrf.getField(6, 0).clear();
    zrf.getField(6, 0).parse("EDCDU^^DGATE");
    
    ((Varies) zrf.getField(7, 0)).setData(new XCN(zrf.getMessage()));
    zrf.getField(7, 0).parse("^^DGATE");
    
    ((Varies) zrf.getField(8, 0)).setData(new CE(zrf.getMessage()));
    zrf.getField(8, 0).parse("^^DGATE");
    
    ((Varies) zrf.getField(9, 0)).setData(new CE(zrf.getMessage()));
    zrf.getField(9, 0).parse("^^DGATE");
    
    ((Varies) zrf.getField(10, 0)).setData(new XCN(zrf.getMessage()));
    ((Varies) zrf.getField(11, 0)).setData(new XCN(zrf.getMessage()));
    ((Varies) zrf.getField(12, 0)).setData(new XCN(zrf.getMessage()));
    zrf.getField(10, 0).parse("");
    zrf.getField(11, 0).parse("R");
    zrf.getField(12, 0).parse("");
}
 
Example 9
Project: rassyeyanie   File: SymA13PimsA12.java   Source Code and License 5 votes vote down vote up
private void transformZrf(Segment zrf, PV1 pv1)
    throws HL7Exception
{
    zrf.getField(1, 0).parse("EMERG^^DGATE");
    zrf.getField(2, 0).parse(
        pv1.getPv144_AdmitDateTime().getTimeOfAnEvent().getValue());
    
    ((Varies) zrf.getField(5, 0)).setData(new XCN(zrf.getMessage()));
    zrf.getField(5, 0).parse("^^DGATE");
    
    zrf.getField(6, 0).clear();
    zrf.getField(6, 0).parse("EDCDU^^DGATE");
    
    ((Varies) zrf.getField(7, 0)).setData(new XCN(zrf.getMessage()));
    zrf.getField(7, 0).parse("^^DGATE");
    
    ((Varies) zrf.getField(8, 0)).setData(new CE(zrf.getMessage()));
    zrf.getField(8, 0).parse("^^DGATE");
    
    ((Varies) zrf.getField(9, 0)).setData(new CE(zrf.getMessage()));
    zrf.getField(9, 0).parse("^^DGATE");
    
    ((Varies) zrf.getField(10, 0)).setData(new XCN(zrf.getMessage()));
    ((Varies) zrf.getField(11, 0)).setData(new XCN(zrf.getMessage()));
    ((Varies) zrf.getField(12, 0)).setData(new XCN(zrf.getMessage()));
    zrf.getField(10, 0).parse("");
    zrf.getField(11, 0).parse("");
    zrf.getField(12, 0).parse("");
}
 
Example 10
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 11
Project: AvoinApotti   File: R01VoMapper.java   Source Code and License 4 votes vote down vote up
private String getReportTextFromOBXGroup(ORU_R01_ORCOBRNTECTDOBXNTEFT1CTI orc_group) throws HL7Exception
	{
		int componentCount = orc_group.getORU_R01_OBXNTEReps();
		StringBuffer ret = new StringBuffer();
		for (int i = 0; i < componentCount; i++)
		{
			ORU_R01_OBXNTE obx_nte = orc_group.getORU_R01_OBXNTE(i);
			OBX obx = obx_nte.getOBX();
//			String obValue=HL7Utils.fromHL7Text(HL7Utils.getValueFromVariant(obx.getObservationValue(0), 0)); //WDEV-6358
			
			
			Varies[] varies = obx.getObservationValue();
			String obValue="";
			if (null!=varies)
			{	
				 for (Varies varies2 : varies)
				 {
					 if(!"".equals(obValue)) // Add a new line if it is not the first
					 {
						 obValue+="\n"; // Newline: result is always displayed as html
					 }
					 String value = HL7Utils.fromHL7Text(HL7Utils.getValueFromVariant(varies2, 0));
					 if(null!=value)
						 obValue +=value; 
				}
			}

			
			
			if(null!=obValue)
				ret.append(obValue);
			ret.append("\r");
			int nteCount = obx_nte.getNTEReps();
			for (int j = 0; j < nteCount; j++)
			{
				NTE nte = obx_nte.getNTE(j);
				int commCount = nte.getComment().length;
				for (int k = 0; k < commCount; k++)
				{
					ret.append(HL7Utils.fromHL7Text(nte.getComment(k).getValue()));	
					ret.append("\r");
				}
			}			
		}
		String returnString = ret.toString();
		//http://jira/browse/WDEV-14838
		if(ConfigFlag.HL7.REMOVE_HL7_INDENT_FORMATTING.getValue())
		{
			if(null!=returnString) 
			{ 
				returnString = returnString.replaceAll("\\\\\\.in[\\+\\-](\\d)*\\\\", " "); 
			} 
		}
		return returnString;
	}
 
Example 12
Project: t5-doc   File: PCD_01MessageToXMLConverter.java   Source Code and License 4 votes vote down vote up
private Element createValueElement(Document doc, OBX obx, Varies value) {
	Element elemValue = doc.createElement("Value");
	elemValue.setTextContent(value.getData().toString());
	elemValue.setAttribute("typeHL7v2", obx.getObx2_ValueType().getValueOrEmpty());
	return elemValue;
}
 
Example 13
Project: OHP-M2M   File: PCD01.java   Source Code and License 4 votes vote down vote up
private void SetOBX10415(String val_bdyWeight, String val_bdyHeight, String val_bdyMassIdx) throws HL7Exception, IOException{
	OBX segOBX = m_Observation.getOBX();
	Varies value = segOBX.getObservationValue(0);
	
	/*-- Body Weight observation result ------------------------------------------------------------*/
	segOBX.getSetIDOBX().setValue("1");
	segOBX.getValueType().setValue("NM");
	segOBX.getObservationSubID().setValue("1");
	segOBX.getObservationIdentifier().getCwe1_Identifier().setValue("57664");
	segOBX.getObservationIdentifier().getCwe2_Text().setValue("MDC_MASS_BODY_ACTUAL");
	segOBX.getObservationIdentifier().getCwe3_NameOfCodingSystem().setValue("MDC");
	
	NM bdyWeight = new NM(m_Msg);
	bdyWeight.setValue(val_bdyWeight);
       value.setData(bdyWeight);
       
       segOBX.getUnits().getCwe1_Identifier().setValue("262688");
       segOBX.getUnits().getCwe2_Text().setValue("MDC_DIM_KILO_G");
       segOBX.getUnits().getCwe3_NameOfCodingSystem().setValue("MDC");
       
       /*-- Body Height observation result ------------------------------------------------------------*/
       segOBX = m_OrderObservation.getOBSERVATION(1).getOBX();
       segOBX.getSetIDOBX().setValue("2");
       segOBX.getValueType().setValue("NM");
       segOBX.getObservationSubID().setValue("1");
       segOBX.getObservationIdentifier().getCwe1_Identifier().setValue("57668");
       segOBX.getObservationIdentifier().getCwe2_Text().setValue("MDC_LEN_BODY_ACTUAL");
       segOBX.getObservationIdentifier().getCwe3_NameOfCodingSystem().setValue("MDC");
       
       NM pulserate = new NM(m_Msg);
       pulserate.setValue(val_bdyHeight);
       value = segOBX.getObservationValue(0);
       value.setData(pulserate);
       
       segOBX.getUnits().getCwe1_Identifier().setValue("263441");
       segOBX.getUnits().getCwe2_Text().setValue("MDC_DIM_CENTI_M"); /* or "MDC_DIM_INCH" */
       segOBX.getUnits().getCwe3_NameOfCodingSystem().setValue("MDC");
       
       /*-- Body Mass observation result --------------------------------------------------------------*/
       segOBX = m_OrderObservation.getOBSERVATION(2).getOBX();
       segOBX.getSetIDOBX().setValue("3");
       segOBX.getValueType().setValue("NM");
       segOBX.getObservationSubID().setValue("1");
       segOBX.getObservationIdentifier().getCwe1_Identifier().setValue("57680");
       segOBX.getObservationIdentifier().getCwe2_Text().setValue("MDC_RATIO_MASS_BODY_LEN_SQ");
       segOBX.getObservationIdentifier().getCwe3_NameOfCodingSystem().setValue("MDC");
       
       NM bdyMassIdx = new NM(m_Msg);
       bdyMassIdx.setValue(val_bdyMassIdx);
       value = segOBX.getObservationValue(0);
       value.setData(bdyMassIdx);
       
       segOBX.getUnits().getCwe1_Identifier().setValue("264096");
       segOBX.getUnits().getCwe2_Text().setValue("MDC_DIM_KG_PER_M_SQ");
       segOBX.getUnits().getCwe3_NameOfCodingSystem().setValue("MDC");
}
 
Example 14
Project: OHP-M2M   File: PCD01.java   Source Code and License 4 votes vote down vote up
private void SetOBX10472(String val_fixMedicationDspsd, String val_varMedicationDspsd, String val_usrFeedback) throws HL7Exception, IOException{
	OBX segOBX = m_Observation.getOBX();
	Varies value = segOBX.getObservationValue(0);
	
	/*-- Fixed-dosage medication dispensed -----------------------------------------------------------------------*/
	segOBX.getSetIDOBX().setValue("1");
	segOBX.getValueType().setValue("NM");
	segOBX.getObservationSubID().setValue("1");
	segOBX.getObservationIdentifier().getCwe1_Identifier().setValue("13312");
	segOBX.getObservationIdentifier().getCwe2_Text().setValue("MDC_AI_MED_DISPENSED_FIXED");
	segOBX.getObservationIdentifier().getCwe3_NameOfCodingSystem().setValue("MDC");
	
	NM fixMedicationDspsd = new NM(m_Msg);
	fixMedicationDspsd.setValue(val_fixMedicationDspsd);
	value.setData(fixMedicationDspsd);
	
	/* Qualifier is NR(Not Required)
	 *segOBX.getUnits().getCwe1_Identifier().setValue("263762");
	 *segOBX.getUnits().getCwe2_Text().setValue("MDC_DIM_MILLI_L");
	 *segOBX.getUnits().getCwe3_NameOfCodingSystem().setValue("MDC");
	 */
	
	/*-- Fixed-dosage medication dispensed -----------------------------------------------------------------------*/
	segOBX = m_OrderObservation.getOBSERVATION(1).getOBX();
	segOBX.getSetIDOBX().setValue("2");
	segOBX.getValueType().setValue("NM");
	segOBX.getObservationSubID().setValue("1");
	segOBX.getObservationIdentifier().getCwe1_Identifier().setValue("13313");
	segOBX.getObservationIdentifier().getCwe2_Text().setValue("MDC_AI_MED_DISPENSED_VARIABLE");
	segOBX.getObservationIdentifier().getCwe3_NameOfCodingSystem().setValue("MDC");
	
	NM varMedicationDspsd = new NM(m_Msg);
	varMedicationDspsd.setValue(val_varMedicationDspsd);
	value = segOBX.getObservationValue(0);
	value.setData(varMedicationDspsd);
	
	segOBX.getUnits().getCwe1_Identifier().setValue("263762");
	segOBX.getUnits().getCwe2_Text().setValue("MDC_DIM_MILLI_L");
	segOBX.getUnits().getCwe3_NameOfCodingSystem().setValue("MDC");
	
	/*-- User Feedback -------------------------------------------------------------------------------------------*/
	segOBX = m_OrderObservation.getOBSERVATION(1).getOBX();
	segOBX.getSetIDOBX().setValue("2");
	segOBX.getValueType().setValue("NM");
	segOBX.getObservationSubID().setValue("1");
	segOBX.getObservationIdentifier().getCwe1_Identifier().setValue("13313");
	segOBX.getObservationIdentifier().getCwe2_Text().setValue("MDC_AI_MED_DISPENSED_VARIABLE");
	segOBX.getObservationIdentifier().getCwe3_NameOfCodingSystem().setValue("MDC");
	
	NM usrFeedback = new NM(m_Msg);
	usrFeedback.setValue(val_usrFeedback);
	value = segOBX.getObservationValue(0);
	value.setData(usrFeedback);
	
	/* Qualifier is NR(Not Required)
	 *segOBX.getUnits().getCwe1_Identifier().setValue("263762");
	 *segOBX.getUnits().getCwe2_Text().setValue("MDC_DIM_MILLI_L");
	 *segOBX.getUnits().getCwe3_NameOfCodingSystem().setValue("MDC");
	 */
}
 
Example 15
Project: openMAXIMS   File: R01VoMapper.java   Source Code and License 4 votes vote down vote up
private String getReportTextFromOBXGroup(ORU_R01_ORCOBRNTECTDOBXNTEFT1CTI orc_group) throws HL7Exception
	{
		int componentCount = orc_group.getORU_R01_OBXNTEReps();
		StringBuffer ret = new StringBuffer();
		for (int i = 0; i < componentCount; i++)
		{
			ORU_R01_OBXNTE obx_nte = orc_group.getORU_R01_OBXNTE(i);
			OBX obx = obx_nte.getOBX();
//			String obValue=HL7Utils.fromHL7Text(HL7Utils.getValueFromVariant(obx.getObservationValue(0), 0)); //WDEV-6358
			
			
			Varies[] varies = obx.getObservationValue();
			String obValue="";
			if (null!=varies)
			{	
				 for (Varies varies2 : varies)
				 {
					 if(!"".equals(obValue)) // Add a new line if it is not the first
					 {
						 obValue+="\n"; // Newline: result is always displayed as html
					 }
					 String value = HL7Utils.fromHL7Text(HL7Utils.getValueFromVariant(varies2, 0));
					 if(null!=value)
						 obValue +=value; 
				}
			}

			
			
			if(null!=obValue)
				ret.append(obValue);
			ret.append("\r");
			int nteCount = obx_nte.getNTEReps();
			for (int j = 0; j < nteCount; j++)
			{
				NTE nte = obx_nte.getNTE(j);
				int commCount = nte.getComment().length;
				for (int k = 0; k < commCount; k++)
				{
					ret.append(HL7Utils.fromHL7Text(nte.getComment(k).getValue()));	
					ret.append("\r");
				}
			}			
		}
		String returnString = ret.toString();
		//http://jira/browse/WDEV-14838
		if(ConfigFlag.HL7.REMOVE_HL7_INDENT_FORMATTING.getValue())
		{
			if(null!=returnString) 
			{ 
				returnString = returnString.replaceAll("\\\\\\.in[\\+\\-](\\d)*\\\\", " "); 
			} 
		}
		return returnString;
	}
 
Example 16
Project: openMAXIMS   File: R01VoMapper.java   Source Code and License 4 votes vote down vote up
private String getReportTextFromOBXGroup(ORU_R01_ORCOBRNTECTDOBXNTEFT1CTI orc_group) throws HL7Exception
	{
		int componentCount = orc_group.getORU_R01_OBXNTEReps();
		StringBuffer ret = new StringBuffer();
		for (int i = 0; i < componentCount; i++)
		{
			ORU_R01_OBXNTE obx_nte = orc_group.getORU_R01_OBXNTE(i);
			OBX obx = obx_nte.getOBX();
//			String obValue=HL7Utils.fromHL7Text(HL7Utils.getValueFromVariant(obx.getObservationValue(0), 0)); //WDEV-6358
			
			
			Varies[] varies = obx.getObservationValue();
			String obValue="";
			if (null!=varies)
			{	
				 for (Varies varies2 : varies)
				 {
					 if(!"".equals(obValue)) // Add a new line if it is not the first
					 {
						 obValue+="\n"; // Newline: result is always displayed as html
					 }
					 String value = HL7Utils.fromHL7Text(HL7Utils.getValueFromVariant(varies2, 0));
					 if(null!=value)
						 obValue +=value; 
				}
			}

			
			
			if(null!=obValue)
				ret.append(obValue);
			ret.append("\r");
			int nteCount = obx_nte.getNTEReps();
			for (int j = 0; j < nteCount; j++)
			{
				NTE nte = obx_nte.getNTE(j);
				int commCount = nte.getComment().length;
				for (int k = 0; k < commCount; k++)
				{
					ret.append(HL7Utils.fromHL7Text(nte.getComment(k).getValue()));	
					ret.append("\r");
				}
			}			
		}
		String returnString = ret.toString();
		//http://jira/browse/WDEV-14838
		if(ConfigFlag.HL7.REMOVE_HL7_INDENT_FORMATTING.getValue())
		{
			if(null!=returnString) 
			{ 
				returnString = returnString.replaceAll("\\\\\\.in[\\+\\-](\\d)*\\\\", " "); 
			} 
		}
		return returnString;
	}
 
Example 17
Project: openmaxims-linux   File: R01VoMapper.java   Source Code and License 4 votes vote down vote up
private String getReportTextFromOBXGroup(ORU_R01_ORCOBRNTECTDOBXNTEFT1CTI orc_group) throws HL7Exception
	{
		int componentCount = orc_group.getORU_R01_OBXNTEReps();
		StringBuffer ret = new StringBuffer();
		for (int i = 0; i < componentCount; i++)
		{
			ORU_R01_OBXNTE obx_nte = orc_group.getORU_R01_OBXNTE(i);
			OBX obx = obx_nte.getOBX();
//			String obValue=HL7Utils.fromHL7Text(HL7Utils.getValueFromVariant(obx.getObservationValue(0), 0)); //WDEV-6358
			
			
			Varies[] varies = obx.getObservationValue();
			String obValue="";
			if (null!=varies)
			{	
				 for (Varies varies2 : varies)
				 {
					 if(!"".equals(obValue)) // Add a new line if it is not the first
					 {
						 obValue+="\n"; // Newline: result is always displayed as html
					 }
					 String value = HL7Utils.fromHL7Text(HL7Utils.getValueFromVariant(varies2, 0));
					 if(null!=value)
						 obValue +=value; 
				}
			}

			
			
			if(null!=obValue)
				ret.append(obValue);
			ret.append("\r");
			int nteCount = obx_nte.getNTEReps();
			for (int j = 0; j < nteCount; j++)
			{
				NTE nte = obx_nte.getNTE(j);
				int commCount = nte.getComment().length;
				for (int k = 0; k < commCount; k++)
				{
					ret.append(HL7Utils.fromHL7Text(nte.getComment(k).getValue()));	
					ret.append("\r");
				}
			}			
		}
		String returnString = ret.toString();
		//http://jira/browse/WDEV-14838
		if(ConfigFlag.HL7.REMOVE_HL7_INDENT_FORMATTING.getValue())
		{
			if(null!=returnString) 
			{ 
				returnString = returnString.replaceAll("\\\\\\.in[\\+\\-](\\d)*\\\\", " "); 
			} 
		}
		return returnString;
	}
 
Example 18
Project: rassyeyanie   File: SymA12PimsA11.java   Source Code and License 4 votes vote down vote up
private void transform(PV1 pv1, AbstractSegment zref)
    throws HL7Exception
{
    pv1.getPv12_PatientClass().setValue("I");
    
    pv1
        .getPv13_AssignedPatientLocation()
        .getPl4_Facility()
        .getHd1_NamespaceID()
        .setValue("KCH");
    pv1
        .getPv13_AssignedPatientLocation()
        .getPl9_LocationDescription()
        .setValue(
            pv1
                .getPv137_DischargedToLocation()
                .getDld2_EffectiveDate()
                .getTs1_TimeOfAnEvent()
                .getValue());
    
    pv1.getPv14_AdmissionType().setValue("21");
    
    for (int i = 6; i <= 8; i++)
    {
        pv1.getField(i, 0).clear();
    }
    
    CE referralBySpecialty = new CE(pv1.getMessage());
    ((Varies) zref.getField(8, 0)).setData(referralBySpecialty);
    
    pv1.getPv110_HospitalService().setValue(
        referralBySpecialty.getCe1_Identifier().getValue());
    
    XCN referredTo = new XCN(pv1.getMessage());
    ((Varies) zref.getField(7, 0)).setData(referredTo);
    pv1
        .getPv117_AdmittingDoctor(0)
        .getXcn1_IDNumber()
        .setValue(referredTo.getXcn1_IDNumber().getValue());
    
    CE admitCategory = new CE(pv1.getMessage());
    ((Varies) zref.getField(12, 0)).setData(admitCategory);
    
    pv1.getPv118_PatientType().setValue(
        admitCategory.getCe1_Identifier().getValue());
    
    pv1.getPv122_CourtesyCode().setValue("NSP");
    
    for (int i = 23; i <= 27; i++)
    {
        pv1.getField(i, 0).clear();
    }
    
    pv1.getPv128_InterestCode().setValue("NSP");
    
    for (int i = 29; i <= 39; i++)
    {
        pv1.getField(i, 0).clear();
    }
    
    pv1.getPv136_DischargeDisposition().setValue("NSP");
    pv1
        .getPv137_DischargedToLocation()
        .getDld1_DischargeLocation()
        .setValue("NSP");
    pv1.getPv138_DietType().getCe1_Identifier().setValue("NA");
    
    pv1.getPv140_BedStatus().setValue("NSP");
    
    for (int i = 45; i <= 49; i++)
    {
        pv1.getField(i, 0).clear();
    }
}
 
Example 19
Project: rassyeyanie   File: SymA02PimsA02.java   Source Code and License 4 votes vote down vote up
private void transform(PV1 pv1, AbstractSegment zref)
    throws HL7Exception
{
    pv1.getPv11_SetIDPV1().clear();
    pv1
        .getPv13_AssignedPatientLocation()
        .getPl9_LocationDescription()
        .setValue(
            pv1
                .getPv137_DischargedToLocation()
                .getDld1_DischargeLocation()
                .getValue());
    pv1
        .getPv13_AssignedPatientLocation()
        .getPl4_Facility()
        .getHd1_NamespaceID()
        .setValue("KCH");
    pv1.getPv16_PriorPatientLocation().getPl4_Facility().clear();
    pv1.getPv16_PriorPatientLocation().getPl9_LocationDescription().clear();
    
    for (int i = 7; i <= 8; i++)
    {
        pv1.getField(i, 0).clear();
    }
    
    XCN referredTo = new XCN(pv1.getMessage());
    ((Varies) zref.getField(7, 0)).setData(referredTo);
    pv1
        .getPv19_ConsultingDoctor(0)
        .getXcn1_IDNumber()
        .setValue(referredTo.getXcn1_IDNumber().getValue());
    
    CE referralBySpecialty = new CE(pv1.getMessage());
    ((Varies) zref.getField(9, 0)).setData(referralBySpecialty);
    
    if (StringUtils.isNotEmpty(referralBySpecialty
        .getCe1_Identifier()
        .getValue()))
    {
        pv1.getPv110_HospitalService().setValue(
            referralBySpecialty.getCe1_Identifier().getValue());
    }
    else
    {
        pv1.getPv110_HospitalService().setValue("NSP");
    }
    
    pv1
        .getPv117_AdmittingDoctor(0)
        .getXcn1_IDNumber()
        .setValue(referredTo.getXcn1_IDNumber().getValue());
    
    CE admitCategory = new CE(pv1.getMessage());
    ((Varies) zref.getField(12, 0)).setData(admitCategory);
    
    pv1.getPv118_PatientType().setValue(
        admitCategory.getCe1_Identifier().getValue());
    
    pv1.getPv122_CourtesyCode().setValue("NSP");
    pv1.getPv128_InterestCode().setValue("NSP");
    pv1.getPv140_BedStatus().setValue("NSP");
    
    for (int i = 46; i <= 52; i++)
    {
        pv1.getField(i, 0).clear();
    }
}
 
Example 20
Project: rassyeyanie   File: SymA03PimsA01.java   Source Code and License 4 votes vote down vote up
public void transform(PV1 pv1, Segment zref, EVN evn)
    throws HL7Exception
{
    
    ADT_A01 a01 = new ADT_A01();
    MSH mshSegment = a01.getMSH();
    mshSegment.getFieldSeparator().setValue("|");
    mshSegment.getEncodingCharacters().setValue("^~\\&");
    PV1 tempPv1 = a01.getPV1();
    ca.uhn.hl7v2.util.DeepCopy.copy(pv1, tempPv1);
    pv1.clear();
    pv1.getPv11_SetIDPV1().setValue(tempPv1.getPv11_SetIDPV1().encode());
    pv1.getPv14_AdmissionType().setValue(
        tempPv1.getPv14_AdmissionType().encode());
    pv1.getPv110_HospitalService().setValue(
        zref.getField(9, 0).encode().toString());
    pv1.getPv114_AdmitSource().setValue(
        tempPv1.getPv114_AdmitSource().encode());
    
    pv1.getPv19_ConsultingDoctor(0).parse(
        zref.getField(7, 0).encode().toString().replace("^^DGATE", ""));
    pv1.getPv12_PatientClass().setValue("I");
    String dischargeLocation =
        tempPv1.getPv137_DischargedToLocation().encode();
    pv1.getPv18_ReferringDoctor(0).parse(
        tempPv1.getPv19_ConsultingDoctor(0).encode());
    pv1.getPv13_AssignedPatientLocation().parse(
        dischargeLocation.split("\\^")[0] + "^^^KCH^^^^^" +
            dischargeLocation.split("\\^")[1]);
    pv1.getPv117_AdmittingDoctor(0).parse(
        tempPv1.getPv117_AdmittingDoctor(0).encode());
    pv1.getPv118_PatientType().parse(
        tempPv1.getPv118_PatientType().encode());
    pv1.getPv119_VisitNumber().parse(
        tempPv1.getPv119_VisitNumber().encode());
    pv1.getPv122_CourtesyCode().setValue("NSP");
    pv1.getPv128_InterestCode().parse(
        tempPv1.getPv128_InterestCode().encode());
    pv1.getPv128_InterestCode().setValue("NSP");
    pv1.getPv140_BedStatus().setValue("NSP");
    pv1.getPv144_AdmitDateTime().parse(
        tempPv1.getPv145_DischargeDateTime(0).encode());
    CE ce = new CE(zref.getMessage());
    ((Varies) zref.getField(1, 0)).setData(ce);
    ce.getCe1_Identifier().setValue("EMERG");
    
    ce.getCe3_NameOfCodingSystem().setValue("DGATE");
    zref.getField(2, 0).parse(
        tempPv1.getPv144_AdmitDateTime().getTs1_TimeOfAnEvent().getValue());
    
    zref.getField(5, 0).parse(zref.getField(5, 0).encode() + "^^DGATE");
    zref.getField(8, 0).parse(zref.getField(9, 0).encode());
    zref.getField(9, 0).parse(zref.getField(9, 0).encode() + "^^DGATE");
    zref.getField(11, 0).parse("R^^DGATE");
    ((Varies) zref.getField(12, 0)).setData(new ST(zref.getMessage()));
    zref.getField(12, 0).clear();
    
}
 
Example 21
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();
}
 
Example 22
Project: rassyeyanie   File: SymA03PimsA03.java   Source Code and License 4 votes vote down vote up
private void transform(PV1 pv1, Segment zref, EVN evn)
    throws HL7Exception
{
    pv1.getPv12_PatientClass().setValue("I");
    pv1
        .getPv13_AssignedPatientLocation()
        .getPl4_Facility()
        .getHd1_NamespaceID()
        .setValue("KCH");
    
    for (int i = 6; i < 9; i++)
        pv1.getField(i, 0).clear();
    
    CE hospitalService = new CE(pv1.getMessage());
    ((Varies) zref.getField(9, 0)).setData(hospitalService);
    
    pv1.getPv110_HospitalService().setValue(
        hospitalService.getCe1_Identifier().getValue());
    
    CE careProvider = new CE(pv1.getMessage());
    ((Varies) zref.getField(7, 0)).setData(careProvider);
    
    pv1
        .getPv117_AdmittingDoctor(0)
        .getXcn1_IDNumber()
        .setValue(careProvider.getCe1_Identifier().getValue());
    
    CE admitCategory = new CE(pv1.getMessage());
    ((Varies) zref.getField(12, 0)).setData(admitCategory);
    
    pv1.getPv118_PatientType().setValue(
        admitCategory.getCe1_Identifier().getValue());
    
    for (int i = 20; i <= 40; i++)
    {
        pv1.getField(i, 0).clear();
    }
    
    pv1.getPv122_CourtesyCode().setValue("NSP");
    pv1.getPv128_InterestCode().setValue("1");
    pv1.getPv136_DischargeDisposition().setValue("CL");
    pv1
        .getPv137_DischargedToLocation()
        .getDld1_DischargeLocation()
        .setValue("U");
    pv1.getPv138_DietType().getCe1_Identifier().setValue("EMERG");
    pv1.getPv140_BedStatus().setValue("NSP");
    
}