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

The following are top voted examples for showing how to use ca.uhn.hl7v2.model.v24.datatype.CE. 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: AvoinApotti   File: R01VoMapper.java   Source Code and License 5 votes vote down vote up
private String formatCommentsList(CE[] commentList, String delimiter)
{
	String ret = "";
	for (int i = 0; commentList != null && i < commentList.length; i++)
		ret += commentList[i].getText() + delimiter;
	return ret;
}
 
Example 2
Project: openMAXIMS   File: R01VoMapper.java   Source Code and License 5 votes vote down vote up
private String formatCommentsList(CE[] commentList, String delimiter)
{
	String ret = "";
	for (int i = 0; commentList != null && i < commentList.length; i++)
		ret += commentList[i].getText() + delimiter;
	return ret;
}
 
Example 3
Project: openMAXIMS   File: R01VoMapper.java   Source Code and License 5 votes vote down vote up
private String formatCommentsList(CE[] commentList, String delimiter)
{
	String ret = "";
	for (int i = 0; commentList != null && i < commentList.length; i++)
		ret += commentList[i].getText() + delimiter;
	return ret;
}
 
Example 4
Project: openmaxims-linux   File: R01VoMapper.java   Source Code and License 5 votes vote down vote up
private String formatCommentsList(CE[] commentList, String delimiter)
{
	String ret = "";
	for (int i = 0; commentList != null && i < commentList.length; i++)
		ret += commentList[i].getText() + delimiter;
	return ret;
}
 
Example 5
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 6
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 7
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 8
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 9
Project: elexis-3-core   File: HL7ReaderV24.java   Source Code and License 5 votes vote down vote up
private String getGroup(String code, CE ce){
	if (HL7_ORU_R01.CODINGSYSTEM_DORNER_GROUP_CODE.equalsIgnoreCase(code)) {
		if (ce.getCe2_Text() != null) {
			return ce.getCe2_Text().getValue();
		}
	}
	return "";
}
 
Example 10
Project: elexis-3-core   File: HL7ReaderV24.java   Source Code and License 5 votes vote down vote up
private String getSequence(String code, CE ce){
	if (HL7_ORU_R01.CODINGSYSTEM_DORNER_GROUP_POSITION.equalsIgnoreCase(code)) {
		if (ce.getCe1_Identifier() != null) {
			return ce.getCe1_Identifier().getValue();
		}
	}
	return "";
}
 
Example 11
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 12
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 13
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 14
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 15
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");
    
}
 
Example 16
Project: elexis-3-core   File: HL7ReaderV24.java   Source Code and License 4 votes vote down vote up
@Override
public ObservationMessage readObservation(HL7PatientResolver patientResolver,
	boolean createIfNotFound) throws ElexisException{
	observation = null;
	ORU_R01 oru = (ORU_R01) message;
	
	try {
		this.patientResolver = patientResolver;
		setPatient(oru, createIfNotFound);
		
		int obsCount = oru.getPATIENT_RESULT().getORDER_OBSERVATIONReps();
		for (int idx = 0; idx < obsCount; idx++) {
			OBR obr = oru.getPATIENT_RESULT().getORDER_OBSERVATION(idx).getOBR();
			String obrObservationDateTime =
				obr.getObr7_ObservationDateTime().getTs1_TimeOfAnEvent().getValue();
				
			setOrderComment(oru, idx, obrObservationDateTime);
			
			for (int i = 0; i < oru.getPATIENT_RESULT().getORDER_OBSERVATION(idx)
				.getOBSERVATIONReps(); i++) {
				ORU_R01_ORDER_OBSERVATION obs =
					oru.getPATIENT_RESULT().getORDER_OBSERVATION(idx);
				// get notes and comments
				String commentNTE = getComments(obs, i);
				
				// groupe and sequence
				String group = "";
				String sequence = "";
				for (int k = 0; k < 2; k++) {
					CE ce = obr.getObr47_FillerSupplementalServiceInformation(k);
					if (ce != null) {
						String code = "";
						if (ce.getCe3_NameOfCodingSystem() != null)
							code = ce.getCe3_NameOfCodingSystem().getValue();
							
						group = getGroup(code, ce);
						sequence = getSequence(code, ce);
						
					}
				}
				
				// result
				readOBXResults(obs.getOBSERVATION(i), commentNTE, group, sequence,
					obrObservationDateTime);
			}
		}
	} catch (HL7Exception | ParseException e) {
		throw new ElexisException(e.getMessage(), e);
	}
	return observation;
}