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

The following are top voted examples for showing how to use ca.uhn.hl7v2.model.v24.datatype.XCN. 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: VoMapper.java   Source Code and License 6 votes vote down vote up
protected final void renderMemberOfStaffShortVoToXCNNatCode(MemberOfStaffShortVo mos, XCN xcn,ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderMemberOfStaffShortVoToXCNNatCode: entry");

	if(mos!=null&&mos.getNameIsNotNull()&&mos.getName().getForenameIsNotNull())
		xcn.getGivenName().setValue(mos.getName().getForename());
	if(mos!=null&&mos.getNameIsNotNull()&&mos.getName().getSurnameIsNotNull())
		xcn.getFamilyName().getSurname().setValue(mos.getName().getSurname());
	if(mos!=null&&mos.getNationalConsCode()!=null)
	{
		xcn.getIDNumber().setValue(mos.getNationalConsCode());
	}
	else if(mos!=null)
	{
		TaxonomyMap mapping = mos.getExternalCode(providerSystem.getCodeSystem());
		if (mapping != null)
		{
			xcn.getIDNumber().setValue(mapping.getTaxonomyCode());			
		}
	}
	LOG.debug("VoMapper renderMemberOfStaffShortVoToXCNNatCode: exit");

}
 
Example 2
Project: AvoinApotti   File: VoMapper.java   Source Code and License 6 votes vote down vote up
protected final void renderGpShortVoToXCN(GpShortVo gp,XCN xcn,ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderGpShortVoToXCN: entry");
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getForenameIsNotNull())
		xcn.getGivenName().setValue(gp.getName().getForename());
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getSurnameIsNotNull())
		xcn.getFamilyName().getSurname().setValue(gp.getName().getSurname());
	TaxonomyMap mapping = null;
	if (gp!=null)
		mapping = gp.getExternalCode(TaxonomyType.NAT_GP_CODE);
	if(mapping!=null)
	{
		xcn.getIDNumber().setValue(mapping.getTaxonomyCode());
	}
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getTitleIsNotNull())
		xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(gp.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));
	LOG.debug("VoMapper renderGpShortVoToXCN: exit");
}
 
Example 3
Project: openMAXIMS   File: VoMapper.java   Source Code and License 6 votes vote down vote up
protected MedicRefVo getReferringConsultant(PV1 pv1, ProviderSystemVo providerSystem) //WDEV-20278
	{
		MedicRefVo hcp=null;
		XCN[] xcns = pv1.getReferringDoctor();
		if (xcns!=null&&xcns.length>0&&xcns[0]!=null)
		{
			hcp= populateMedicRefFromXCN(xcns[0],TaxonomyType.NAT_CONS_CODE);
		}
		if(hcp==null&&xcns.length>1&&xcns[1]!=null)
		{
			//WDEV-20278
//			hcp=populateMedicRefFromXCN(xcns[1],TaxonomyType.PAS);
			hcp = populateMedicRefFromXCN(xcns[1], providerSystem.getCodeSystem()); //WDEV-20278
		}
		return hcp;
	}
 
Example 4
Project: openMAXIMS   File: VoMapper.java   Source Code and License 6 votes vote down vote up
protected HcpMinVo getAttendingDoctor(PV1 pv1, ProviderSystemVo providerSystem) //WDEV-20278
	{
		HcpMinVo hcp=null;
		XCN[] xcns = pv1.getAttendingDoctor();
		if (xcns!=null&&xcns.length>0&&xcns[0]!=null)
		{
			hcp= populateHcpMinFromXCN(xcns[0],TaxonomyType.NAT_CONS_CODE);
		}
		if(hcp==null&&xcns.length>1&&xcns[1]!=null)
		{
			//WDEV-20278
//			hcp=populateHcpMinFromXCN(xcns[1],TaxonomyType.PAS);
			hcp = populateHcpMinFromXCN(xcns[1], providerSystem.getCodeSystem()); //WDEV-20278
		}
		return hcp;
	}
 
Example 5
Project: openMAXIMS   File: VoMapper.java   Source Code and License 6 votes vote down vote up
protected final void renderGpShortVoToXCN(GpShortVo gp, XCN xcn, ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderGpShortVoToXCN: entry");
	
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getForenameIsNotNull())
		xcn.getGivenName().setValue(gp.getName().getForename());
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getSurnameIsNotNull())
		xcn.getFamilyName().getSurname().setValue(gp.getName().getSurname());
	TaxonomyMap mapping = null;
	if (gp!=null)
		mapping = gp.getExternalCode(TaxonomyType.NAT_GP_CODE);
	if(mapping!=null)
	{
		xcn.getIDNumber().setValue(mapping.getTaxonomyCode());
	}
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getTitleIsNotNull())
		xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(gp.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));

	LOG.debug("VoMapper renderGpShortVoToXCN: exit");
}
 
Example 6
Project: openMAXIMS   File: VoMapper.java   Source Code and License 6 votes vote down vote up
protected final void renderMemberOfStaffShortVoToXCNNatCode(MemberOfStaffShortVo mos, XCN xcn,ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderMemberOfStaffShortVoToXCNNatCode: entry");

	if(mos!=null&&mos.getNameIsNotNull()&&mos.getName().getForenameIsNotNull())
		xcn.getGivenName().setValue(mos.getName().getForename());
	if(mos!=null&&mos.getNameIsNotNull()&&mos.getName().getSurnameIsNotNull())
		xcn.getFamilyName().getSurname().setValue(mos.getName().getSurname());
	if(mos!=null&&mos.getNationalConsCode()!=null)
	{
		xcn.getIDNumber().setValue(mos.getNationalConsCode());
	}
	else if(mos!=null)
	{
		TaxonomyMap mapping = mos.getExternalCode(providerSystem.getCodeSystem());
		if (mapping != null)
		{
			xcn.getIDNumber().setValue(mapping.getTaxonomyCode());			
		}
	}
	LOG.debug("VoMapper renderMemberOfStaffShortVoToXCNNatCode: exit");

}
 
Example 7
Project: openMAXIMS   File: VoMapper.java   Source Code and License 6 votes vote down vote up
protected final void renderGpShortVoToXCN(GpShortVo gp,XCN xcn,ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderGpShortVoToXCN: entry");
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getForenameIsNotNull())
		xcn.getGivenName().setValue(gp.getName().getForename());
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getSurnameIsNotNull())
		xcn.getFamilyName().getSurname().setValue(gp.getName().getSurname());
	TaxonomyMap mapping = null;
	if (gp!=null)
		mapping = gp.getExternalCode(TaxonomyType.NAT_GP_CODE);
	if(mapping!=null)
	{
		xcn.getIDNumber().setValue(mapping.getTaxonomyCode());
	}
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getTitleIsNotNull())
		xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(gp.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));
	LOG.debug("VoMapper renderGpShortVoToXCN: exit");
}
 
Example 8
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 6 votes vote down vote up
protected final void renderMemberOfStaffShortVoToXCNNatCode(MemberOfStaffShortVo mos, XCN xcn,ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderMemberOfStaffShortVoToXCNNatCode: entry");

	if(mos!=null&&mos.getNameIsNotNull()&&mos.getName().getForenameIsNotNull())
		xcn.getGivenName().setValue(mos.getName().getForename());
	if(mos!=null&&mos.getNameIsNotNull()&&mos.getName().getSurnameIsNotNull())
		xcn.getFamilyName().getSurname().setValue(mos.getName().getSurname());
	if(mos!=null&&mos.getNationalConsCode()!=null)
	{
		xcn.getIDNumber().setValue(mos.getNationalConsCode());
	}
	else if(mos!=null)
	{
		TaxonomyMap mapping = mos.getExternalCode(providerSystem.getCodeSystem());
		if (mapping != null)
		{
			xcn.getIDNumber().setValue(mapping.getTaxonomyCode());			
		}
	}
	LOG.debug("VoMapper renderMemberOfStaffShortVoToXCNNatCode: exit");

}
 
Example 9
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 6 votes vote down vote up
protected final void renderGpShortVoToXCN(GpShortVo gp,XCN xcn,ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderGpShortVoToXCN: entry");
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getForenameIsNotNull())
		xcn.getGivenName().setValue(gp.getName().getForename());
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getSurnameIsNotNull())
		xcn.getFamilyName().getSurname().setValue(gp.getName().getSurname());
	TaxonomyMap mapping = null;
	if (gp!=null)
		mapping = gp.getExternalCode(TaxonomyType.NAT_GP_CODE);
	if(mapping!=null)
	{
		xcn.getIDNumber().setValue(mapping.getTaxonomyCode());
	}
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getTitleIsNotNull())
		xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(gp.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));
	LOG.debug("VoMapper renderGpShortVoToXCN: exit");
}
 
Example 10
Project: elexis-3-core   File: HL7ReaderV24.java   Source Code and License 6 votes vote down vote up
private OrcMessage extractOrc(ORC orc) throws HL7Exception{
	if (orc != null) {
		OrcMessage orcMessage = new OrcMessage();
		XCN[] ops = orc.getOrderingProvider();
		for (XCN op : ops) {
			FN fn = op.getFamilyName();
			ST familyName = null;
			if (fn != null) {
				familyName = fn.getSurname();
				if (familyName == null) {
					familyName = fn.getOwnSurname();
				}
			}
			addNameValuesToOrcMessage(op.getGivenName(), familyName, orcMessage);
		}
		return orcMessage;
	}
	return null;
}
 
Example 11
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected MedicRefVo getReferringConsultant(PV1 pv1)
{
	MedicRefVo hcp=null;
	XCN[] xcns = pv1.getReferringDoctor();
	if (xcns!=null&&xcns.length>0&&xcns[0]!=null)
	{
		hcp= populateMedicRefFromXCN(xcns[0],TaxonomyType.NAT_CONS_CODE);
	}
	if(hcp==null&&xcns.length>1&&xcns[1]!=null)
	{
		hcp=populateMedicRefFromXCN(xcns[1],TaxonomyType.PAS);
	}
	return hcp;
}
 
Example 12
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected HcpMinVo getAttendingDoctor(PV1 pv1)
{
	HcpMinVo hcp=null;
	XCN[] xcns = pv1.getAttendingDoctor();
	if (xcns!=null&&xcns.length>0&&xcns[0]!=null)
	{
		hcp= populateHcpMinFromXCN(xcns[0],TaxonomyType.NAT_CONS_CODE);
	}
	if(hcp==null&&xcns.length>1&&xcns[1]!=null)
	{
		hcp=populateHcpMinFromXCN(xcns[1],TaxonomyType.PAS);
	}
	return hcp;
}
 
Example 13
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected GpShortVo populateGPVoFromXCN(XCN xcn, TaxonomyType taxType)
{
	String pasCode = xcn.getIDNumber().getValue();
	if (pasCode != null)
	{
		GpShortVo gp = gpAdmin.getGPByTaxonomyType(pasCode, taxType);
		return gp;
	}
	return null;
}
 
Example 14
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final MemberOfStaffLiteVo populateMemberOfStaffShortVoFromXCN(XCN xcn, TaxonomyType taxType)
{
	// Get the PAS Code and get Mos from there
	String pasCode = xcn.getIDNumber().getValue();
	if (pasCode != null)
	{
		MemberOfStaffLiteVo mosVo = mosAdmin.getMemberOfStaffLiteByTaxonomyType(pasCode, taxType);
		return mosVo;
	}
	return null;
}
 
Example 15
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final HcpLiteVo populateHcpVoFromXCN(XCN xcn, TaxonomyType taxType)
{
	String pasCode = xcn.getIDNumber().getValue();
	if (pasCode != null)
	{
		return mosAdmin.getHcpLiteByTaxonomyType(pasCode, taxType);
	}
	return null;
}
 
Example 16
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final MedicRefVo populateMedicRefFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getMedicRefByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 17
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final HcpRefVo populateHcpRefFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getHcpRefByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 18
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final HcpMinVo populateHcpMinFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getHcpMinByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 19
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final void renderMemberOfStaffShortVoToXCN(MemberOfStaffShortVo mos, XCN xcn,ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderMemberOfStaffShortVoToXCN: entry");

	xcn.getGivenName().setValue(mos.getName().getForename());
	xcn.getFamilyName().getSurname().setValue(mos.getName().getSurname());
	TaxonomyMap mapping = mos.getExternalCode(providerSystem.getCodeSystem());
	if (mapping != null)
	{
		xcn.getIDNumber().setValue(mapping.getTaxonomyCode());			
	}
	LOG.debug("VoMapper renderMemberOfStaffShortVoToXCN: exit");

}
 
Example 20
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected GpShortVo populateGPVoFromXCN(XCN xcn, TaxonomyType taxType)
{
	String pasCode = xcn.getIDNumber().getValue();
	if (pasCode != null)
	{
		GpShortVo gp = gpAdmin.getGPByTaxonomyType(pasCode, taxType);
		return gp;
	}
	return null;
}
 
Example 21
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final MemberOfStaffLiteVo populateMemberOfStaffShortVoFromXCN(XCN xcn, TaxonomyType taxType)
{
	// Get the PAS Code and get Mos from there
	String pasCode = xcn.getIDNumber().getValue();
	if (pasCode != null)
	{
		MemberOfStaffLiteVo mosVo = mosAdmin.getMemberOfStaffLiteByTaxonomyType(pasCode, taxType);
		return mosVo;
	}
	return null;
}
 
Example 22
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final HcpLiteVo populateHcpVoFromXCN(XCN xcn, TaxonomyType taxType)
{
	String pasCode = xcn.getIDNumber().getValue();
	if (pasCode != null)
	{
		return mosAdmin.getHcpLiteByTaxonomyType(pasCode, taxType);
	}
	return null;
}
 
Example 23
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final MedicRefVo populateMedicRefFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getMedicRefByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 24
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final HcpRefVo populateHcpRefFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getHcpRefByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 25
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final HcpMinVo populateHcpMinFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getHcpMinByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 26
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected MedicRefVo getReferringConsultant(PV1 pv1)
{
	MedicRefVo hcp=null;
	XCN[] xcns = pv1.getReferringDoctor();
	if (xcns!=null&&xcns.length>0&&xcns[0]!=null)
	{
		hcp= populateMedicRefFromXCN(xcns[0],TaxonomyType.NAT_CONS_CODE);
	}
	if(hcp==null&&xcns.length>1&&xcns[1]!=null)
	{
		hcp=populateMedicRefFromXCN(xcns[1],TaxonomyType.PAS);
	}
	return hcp;
}
 
Example 27
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected HcpMinVo getAttendingDoctor(PV1 pv1)
{
	HcpMinVo hcp=null;
	XCN[] xcns = pv1.getAttendingDoctor();
	if (xcns!=null&&xcns.length>0&&xcns[0]!=null)
	{
		hcp= populateHcpMinFromXCN(xcns[0],TaxonomyType.NAT_CONS_CODE);
	}
	if(hcp==null&&xcns.length>1&&xcns[1]!=null)
	{
		hcp=populateHcpMinFromXCN(xcns[1],TaxonomyType.PAS);
	}
	return hcp;
}
 
Example 28
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected GpShortVo populateGPVoFromXCN(XCN xcn, TaxonomyType taxType)
{
	String pasCode = xcn.getIDNumber().getValue();
	if (pasCode != null)
	{
		GpShortVo gp = gpAdmin.getGPByTaxonomyType(pasCode, taxType);
		return gp;
	}
	return null;
}
 
Example 29
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final MemberOfStaffLiteVo populateMemberOfStaffShortVoFromXCN(XCN xcn, TaxonomyType taxType)
{
	// Get the PAS Code and get Mos from there
	String pasCode = xcn.getIDNumber().getValue();
	if (pasCode != null)
	{
		MemberOfStaffLiteVo mosVo = mosAdmin.getMemberOfStaffLiteByTaxonomyType(pasCode, taxType);
		return mosVo;
	}
	return null;
}
 
Example 30
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final HcpLiteVo populateHcpVoFromXCN(XCN xcn, TaxonomyType taxType)
{
	String pasCode = xcn.getIDNumber().getValue();
	if (pasCode != null)
	{
		return mosAdmin.getHcpLiteByTaxonomyType(pasCode, taxType);
	}
	return null;
}
 
Example 31
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final MedicRefVo populateMedicRefFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getMedicRefByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 32
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final HcpRefVo populateHcpRefFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getHcpRefByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 33
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final HcpMinVo populateHcpMinFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getHcpMinByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 34
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final void renderMemberOfStaffShortVoToXCN(MemberOfStaffShortVo mos, XCN xcn,ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderMemberOfStaffShortVoToXCN: entry");

	xcn.getGivenName().setValue(mos.getName().getForename());
	xcn.getFamilyName().getSurname().setValue(mos.getName().getSurname());
	TaxonomyMap mapping = mos.getExternalCode(providerSystem.getCodeSystem());
	if (mapping != null)
	{
		xcn.getIDNumber().setValue(mapping.getTaxonomyCode());			
	}
	LOG.debug("VoMapper renderMemberOfStaffShortVoToXCN: exit");

}
 
Example 35
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected MedicRefVo getReferringConsultant(PV1 pv1)
{
	MedicRefVo hcp=null;
	XCN[] xcns = pv1.getReferringDoctor();
	if (xcns!=null&&xcns.length>0&&xcns[0]!=null)
	{
		hcp= populateMedicRefFromXCN(xcns[0],TaxonomyType.NAT_CONS_CODE);
	}
	if(hcp==null&&xcns.length>1&&xcns[1]!=null)
	{
		hcp=populateMedicRefFromXCN(xcns[1],TaxonomyType.PAS);
	}
	return hcp;
}
 
Example 36
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected HcpMinVo getAttendingDoctor(PV1 pv1)
{
	HcpMinVo hcp=null;
	XCN[] xcns = pv1.getAttendingDoctor();
	if (xcns!=null&&xcns.length>0&&xcns[0]!=null)
	{
		hcp= populateHcpMinFromXCN(xcns[0],TaxonomyType.NAT_CONS_CODE);
	}
	if(hcp==null&&xcns.length>1&&xcns[1]!=null)
	{
		hcp=populateHcpMinFromXCN(xcns[1],TaxonomyType.PAS);
	}
	return hcp;
}
 
Example 37
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected GpShortVo populateGPVoFromXCN(XCN xcn, TaxonomyType taxType)
{
	String pasCode = xcn.getIDNumber().getValue();
	if (pasCode != null)
	{
		GpShortVo gp = gpAdmin.getGPByTaxonomyType(pasCode, taxType);
		return gp;
	}
	return null;
}
 
Example 38
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final MemberOfStaffLiteVo populateMemberOfStaffShortVoFromXCN(XCN xcn, TaxonomyType taxType)
{
	// Get the PAS Code and get Mos from there
	String pasCode = xcn.getIDNumber().getValue();
	if (pasCode != null)
	{
		MemberOfStaffLiteVo mosVo = mosAdmin.getMemberOfStaffLiteByTaxonomyType(pasCode, taxType);
		return mosVo;
	}
	return null;
}
 
Example 39
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final HcpLiteVo populateHcpVoFromXCN(XCN xcn, TaxonomyType taxType)
{
	String pasCode = xcn.getIDNumber().getValue();
	if (pasCode != null)
	{
		return mosAdmin.getHcpLiteByTaxonomyType(pasCode, taxType);
	}
	return null;
}
 
Example 40
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final MedicRefVo populateMedicRefFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getMedicRefByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 41
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final HcpRefVo populateHcpRefFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getHcpRefByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 42
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final HcpMinVo populateHcpMinFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getHcpMinByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 43
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final void renderMemberOfStaffShortVoToXCN(MemberOfStaffShortVo mos, XCN xcn,ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderMemberOfStaffShortVoToXCN: entry");

	xcn.getGivenName().setValue(mos.getName().getForename());
	xcn.getFamilyName().getSurname().setValue(mos.getName().getSurname());
	TaxonomyMap mapping = mos.getExternalCode(providerSystem.getCodeSystem());
	if (mapping != null)
	{
		xcn.getIDNumber().setValue(mapping.getTaxonomyCode());			
	}
	LOG.debug("VoMapper renderMemberOfStaffShortVoToXCN: exit");

}
 
Example 44
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 45
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 46
Project: AvoinApotti   File: R01VoMapper.java   Source Code and License 4 votes vote down vote up
private void populateWithOrderingProvider(IfOcsOrderVo order, ORC orc, OBR obr, ProviderSystemVo providerSystem) throws HL7Exception
{
	
	XCN orderingProvider=null;
	if (orc.getOrderingProvider(0) != null && orc.getOrderingProvider(0).getIDNumber().getValue() != null)
	{		
		orderingProvider = orc.getOrderingProvider(0);
	}
	if (orderingProvider == null)
	{
		//Need to also check OBR-16   Ordering provider  (XCN)
		if (obr.getOrderingProvider(0) != null && obr.getOrderingProvider(0).getIDNumber().getValue() != null)
		{
			orderingProvider = obr.getOrderingProvider(0);
		}
	}
	
	if (orderingProvider != null)
	{
		HcpLiteVo hcp = populateHcpVoFromXCN(orderingProvider, providerSystem.getCodeSystem());
		if (hcp != null)
		{
			order.setResponsibleClinician(hcp);
			if (!order.getOrderedByIsNotNull())  // wdev-4443
				order.setOrderedBy(hcp.getMos());
		}
		else
		{
			GpShortVo gp = populateGPVoFromXCN(orderingProvider, providerSystem.getCodeSystem());
			if (gp == null)
			{
				// We need to log the fact that the GP is not on our system
				LOG.warn("GP with code " + orderingProvider.getIDNumber() + " was not found on the IMS database");												
			}
			else
			{
				order.setResponsibleGp(gp);
			}
		}
		//WDEV-8884 
		if(ConfigFlag.HL7.REJECT_RESULTS_FOR_UNKNOWN_ORDERINGPROVIDER_OR_LOCATION.getValue())
		{
			// wdev-2746 If Neither Clinician nor GP are populated, reject the message as
			// one or the other are mandatory
			if (orderingProvider.getIDNumber().getValue() != null &&
					!order.getResponsibleClinicianIsNotNull() && !order.getResponsibleGpIsNotNull())
			{
				throw new HL7Exception("Ordering Provider (ORC-12, OBR-16) does not map to a valid Clinician or GP - Message Rejected");
			}
		}
	}

}
 
Example 47
Project: openMAXIMS   File: VoMapper.java   Source Code and License 4 votes vote down vote up
protected final void renderMemberOfStaffShortVoToXCN(MemberOfStaffShortVo mos, XCN xcn,ProviderSystemVo providerSystem) throws DataTypeException
	{
		LOG.debug("VoMapper renderMemberOfStaffShortVoToXCN: entry");


		//WDEV-20083
//			if(mos!=null&&mos.getNameIsNotNull()&&mos.getName().getForenameIsNotNull())
//				xcn.getGivenName().setValue(mos.getName().getForename());
//			if(mos!=null&&mos.getNameIsNotNull()&&mos.getName().getSurnameIsNotNull())
//				xcn.getFamilyName().getSurname().setValue(mos.getName().getSurname());
		if(mos.getNameIsNotNull())
		{
			if(mos.getName().getForenameIsNotNull())
			{
				xcn.getGivenName().setValue(mos.getName().getForename());
			}
			if(mos.getName().getSurnameIsNotNull())
			{
				xcn.getFamilyName().getSurname().setValue(mos.getName().getSurname());
			}
			if(mos.getName().getTitleIsNotNull()
				&& mos.getName().getTitle().getID() > 0)
			{
				xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(mos.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));
			}
		}
		//WDEV-20083
			
		if(mos != null 
			&& mos.getNationalConsCode() != null)
		{
			xcn.getIDNumber().setValue(mos.getNationalConsCode());
		}
		else if(mos != null)
		{
			TaxonomyMap mapping = mos.getExternalCode(providerSystem.getCodeSystem());
			if (mapping != null)
			{
				xcn.getIDNumber().setValue(mapping.getTaxonomyCode());
			}
		}

		LOG.debug("VoMapper renderMemberOfStaffShortVoToXCN: exit");
	}
 
Example 48
Project: openMAXIMS   File: VoMapper.java   Source Code and License 4 votes vote down vote up
protected final void renderMemberOfStaffShortVoToXCNNatCode(MemberOfStaffShortVo mos, XCN xcn, ProviderSystemVo providerSystem) throws DataTypeException
	{
		LOG.debug("VoMapper renderMemberOfStaffShortVoToXCNNatCode: entry");

		//		//WDEV-20083
//		if(mos!=null&&mos.getNameIsNotNull()&&mos.getName().getForenameIsNotNull())
//			xcn.getGivenName().setValue(mos.getName().getForename());
//		if(mos!=null&&mos.getNameIsNotNull()&&mos.getName().getSurnameIsNotNull())
//			xcn.getFamilyName().getSurname().setValue(mos.getName().getSurname());
		if(mos.getNameIsNotNull())
		{
			if(mos.getName().getForenameIsNotNull())
			{
				xcn.getGivenName().setValue(mos.getName().getForename());
			}
			if(mos.getName().getSurnameIsNotNull())
			{
				xcn.getFamilyName().getSurname().setValue(mos.getName().getSurname());
			}
			if(mos.getName().getTitleIsNotNull()
				&& mos.getName().getTitle().getID() > 0)
			{
				xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(mos.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));
			}
		}
		//WDEV-20083
		
		if(mos != null 
			&& mos.getNationalConsCode() != null)
		{
			xcn.getIDNumber().setValue(mos.getNationalConsCode());
		}
		else if(mos != null)
		{
			TaxonomyMap mapping = mos.getExternalCode(providerSystem.getCodeSystem());
			if (mapping != null)
			{
				xcn.getIDNumber().setValue(mapping.getTaxonomyCode());
			}
		}
		
		LOG.debug("VoMapper renderMemberOfStaffShortVoToXCNNatCode: exit");
	}
 
Example 49
Project: openMAXIMS   File: VoMapper.java   Source Code and License 4 votes vote down vote up
protected final void renderGpLiteVoToXCN(GpLiteVo gp, XCN xcn, ProviderSystemVo providerSystem) throws DataTypeException
	{
		LOG.debug("VoMapper renderGpLiteVoToXCN: entry");

		if(gp != null)
		{
			//XCN.0 ID number (ST)
			TaxonomyMap mapping = null;
			mapping = gp.getExternalCode(TaxonomyType.NAT_GP_CODE);
			if(mapping != null 
					&& mapping.getTaxonomyCode() != null)
			{
				xcn.getIDNumber().setValue(mapping.getTaxonomyCode());
			}			
			//XCN.1 Family Name (FN)
			if(gp.getNameIsNotNull() 
				&& gp.getName().getSurnameIsNotNull() 
				&& gp.getName().getSurname().length() > 0)
			{
				xcn.getFamilyName().getSurname().setValue(gp.getName().getSurname());
			}
			//XCN.2 Given name (ST)
			if(gp.getNameIsNotNull() 
				&& gp.getName().getForenameIsNotNull() 
				&& gp.getName().getForename().length() > 0)
			{
				xcn.getGivenName().setValue(gp.getName().getForename());
			}
			//XCN.5 Suffix (ST)
			if(gp.getNameIsNotNull() 
				&& gp.getName().getTitleIsNotNull() 
				&& gp.getName().getTitle().getId() > 0)
			{
				xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(gp.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));
			}
			
//			//WDEV-2100
//			//XCN.9 Assigning authority (HD)
//			if (mapping != null
//					&& mapping.getTaxonomyName() != null)
//			{
//				xcn.getAssigningAuthority().getNamespaceID().setValue(mapping.getTaxonomyName().toString());
//
//				TaxonomyType taxonomyType = mapping.getTaxonomyName();
//				if (taxonomyType != null)
//				{
//					String taxTypeText = svc.getRemoteLookup(taxonomyType.getID(), providerSystem.getCodeSystem().getText());
//					if (taxTypeText != null)
//					{
//						//XCN.10 Name type code (ID)
//						xcn.getNameTypeCode().setValue(taxTypeText);
//					}
//				}
//			}
		}
			
		LOG.debug("VoMapper renderGpLiteVoToXCN: exit");
	}
 
Example 50
Project: openMAXIMS   File: VoMapper.java   Source Code and License 4 votes vote down vote up
protected final void renderMedicWithMappingsLiteVoToXCN(MedicWithMappingsLiteVo medic, XCN xcn, ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderMedicWithMappingsLiteVoToXCN: entry");

	if (medic != null)
	{
		//WDEV-2100
		TaxonomyMap natConsCodeMapping = medic.getMos().getExternalCode(TaxonomyType.NAT_CONS_CODE);
				
		// XCN.1 ID number (ST)
		if (natConsCodeMapping != null
				&& natConsCodeMapping.getTaxonomyCode() != null)
		{
			xcn.getIDNumber().setValue(natConsCodeMapping.getTaxonomyCode());
		}
		
		//XCN.2 Family Name (FN)
		if (medic.getMos().getNameIsNotNull() 
				&& medic.getName().getSurnameIsNotNull() 
				&& medic.getName().getSurname().length() > 0)
		{
			xcn.getFamilyName().getSurname().setValue(medic.getName().getSurname());
		}
		
		//XCN.3 Given name (ST)
		if (medic.getName().getSurnameIsNotNull() 
				&& medic.getName().getForenameIsNotNull() 
				&& medic.getName().getForename().length() > 0)
		{
			xcn.getGivenName().setValue(medic.getName().getForename());
		}
		
		//XCN.5 Prefix (ST)
		if (medic.getMos().getNameIsNotNull() 
				&& medic.getName().getTitleIsNotNull() 
				&& medic.getName().getTitle().getID() > 0)
		{
			xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(medic.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));
		}
		
	}

	LOG.debug("VoMapper renderMedicWithMappingsLiteVoToXCN: exit");
}
 
Example 51
Project: openMAXIMS   File: VoMapper.java   Source Code and License 4 votes vote down vote up
protected final void renderHcpToXCN(ims.core.vo.Hcp hcp, XCN xcn, ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderHcpToXCN: entry");

	if (hcp != null && hcp.getMos() != null)
	{
		//WDEV-2100
		TaxonomyMap natConsCodeMapping = hcp.getMos().getExternalCode(TaxonomyType.NAT_CONS_CODE);

		// XCN.0 ID number (ST)
		if (natConsCodeMapping != null
				&& natConsCodeMapping.getTaxonomyCode() != null)
		{
			xcn.getIDNumber().setValue(natConsCodeMapping.getTaxonomyCode().toString());
		} 
		
		//XCN.1 Family Name (FN)
		if (hcp.getMos().getNameIsNotNull() 
				&& hcp.getName().getSurnameIsNotNull() 
				&& hcp.getName().getSurname().length() > 0)
		{
			xcn.getFamilyName().getSurname().setValue(hcp.getName().getSurname());
		}
		
		//XCN.2 Given name (ST)
		if (hcp.getName().getSurnameIsNotNull() 
				&& hcp.getName().getForenameIsNotNull() 
				&& hcp.getName().getForename().length() > 0)
		{
			xcn.getGivenName().setValue(hcp.getName().getForename());
		}
		
		//XCN.5 Prefix (ST)
		if (hcp.getMos().getNameIsNotNull() 
				&& hcp.getName().getTitleIsNotNull() 
				&& hcp.getName().getTitle().getID() > 0)
		{
			xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(hcp.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));
		}
		
	}

	LOG.debug("VoMapper renderHcpToXCN: exit");
}
 
Example 52
Project: openMAXIMS   File: R01VoMapper.java   Source Code and License 4 votes vote down vote up
private void populateWithOrderingProvider(IfOcsOrderVo order, ORC orc, OBR obr, ProviderSystemVo providerSystem) throws HL7Exception
{
	
	XCN orderingProvider=null;
	if (orc.getOrderingProvider(0) != null && orc.getOrderingProvider(0).getIDNumber().getValue() != null)
	{		
		orderingProvider = orc.getOrderingProvider(0);
	}
	if (orderingProvider == null)
	{
		//Need to also check OBR-16   Ordering provider  (XCN)
		if (obr.getOrderingProvider(0) != null && obr.getOrderingProvider(0).getIDNumber().getValue() != null)
		{
			orderingProvider = obr.getOrderingProvider(0);
		}
	}
	
	if (orderingProvider != null)
	{
		HcpLiteVo hcp = populateHcpVoFromXCN(orderingProvider, providerSystem.getCodeSystem());
		if (hcp != null)
		{
			order.setResponsibleClinician(hcp);
			if (!order.getOrderedByIsNotNull())  // wdev-4443
				order.setOrderedBy(hcp.getMos());
		}
		else
		{
			GpShortVo gp = populateGPVoFromXCN(orderingProvider, providerSystem.getCodeSystem());
			if (gp == null)
			{
				// We need to log the fact that the GP is not on our system
				LOG.warn("GP with code " + orderingProvider.getIDNumber() + " was not found on the IMS database");												
			}
			else
			{
				order.setResponsibleGp(gp);
			}
		}
		//WDEV-8884 
		if(ConfigFlag.HL7.REJECT_RESULTS_FOR_UNKNOWN_ORDERINGPROVIDER_OR_LOCATION.getValue())
		{
			// wdev-2746 If Neither Clinician nor GP are populated, reject the message as
			// one or the other are mandatory
			if (orderingProvider.getIDNumber().getValue() != null &&
					!order.getResponsibleClinicianIsNotNull() && !order.getResponsibleGpIsNotNull())
			{
				throw new HL7Exception("Ordering Provider (ORC-12, OBR-16) does not map to a valid Clinician or GP - Message Rejected");
			}
		}
	}

}
 
Example 53
Project: openMAXIMS   File: S12VoMapper.java   Source Code and License 4 votes vote down vote up
protected final void renderMemberOfStaffShortVoToXCNX(MemberOfStaffShortVo mos, AIP aip, ProviderSystemVo providerSystem) throws HL7Exception
	{
		
		//WDEV-21000 Following logic is wrong - replaced below.
		
//		int startPos=0;
//		
//		if (aip.getPersonnelResourceID().length > 0)
//		{
//			startPos = aip.getPersonnelResourceID().length-1;
//		}
//
//		if (mos.getCodeMappings() != null)
//		{
//			for (int i = 0; i < mos.getCodeMappings().size(); i++)
//			{
//				ims.core.vo.TaxonomyMap map = mos.getCodeMappings().get(i);
//				if (map.getTaxonomyName().equals(providerSystem.getCodeSystem()))
//				{
//					XCN xcnNew = aip.getPersonnelResourceID(startPos);
//					xcnNew.getGivenName().setValue(mos.getName().getForename());
//					xcnNew.getFamilyName().getSurname().setValue(mos.getName().getSurname());
//					xcnNew.getIDNumber().setValue(map.getTaxonomyCode());
//					//WDEV-21000
//					TaxonomyType taxonomyType = map.getTaxonomyName();
//					if (taxonomyType != null)
//					{
//						String taxTypeText = svc.getRemoteLookup(taxonomyType.getID(), providerSystem.getCodeSystem().getText());
//						if (taxTypeText != null)
//						{
//							xcnNew.getAssigningAuthority().getNamespaceID().setValue(map.getTaxonomyName().toString());
//						}
//					}
//					
//					startPos++;
//				}
//				
//			}
//		}
//	}

		LOG.debug("VoMapper renderMemberOfStaffShortVoToXCNX: entry");
	
		if (mos != null)
		{
			XCN xcn = aip.getPersonnelResourceID(0);

			TaxonomyMap mapping = mos.getExternalCode(TaxonomyType.NAT_CONS_CODE);
			if (!(mapping != null && mapping.getTaxonomyCode() != null))
			{
				mapping = mos.getExternalCode(providerSystem.getCodeSystem());
			}

			if (mapping != null && mapping.getTaxonomyCode() != null)
			{
				//XCN.0 ID Number (ST)
				xcn.getIDNumber().setValue(mapping.getTaxonomyCode());
			}

			if (mos.getNameIsNotNull())
			{
				//XCN.1 Family name (ST)
				if (mos.getName().getSurnameIsNotNull())
					xcn.getFamilyName().getSurname().setValue(mos.getName().getSurname().toString());
				//XCN.2 Given name (ST)
				if (mos.getName().getForenameIsNotNull())
					xcn.getGivenName().setValue(mos.getName().getForename().toString());
				//XCN.5 Prefix (ST)
				if(mos.getName().getTitleIsNotNull()) 
					xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(mos.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));
			}
		}
	
		LOG.debug("VoMapper renderMemberOfStaffShortVoToXCNX: exit");

	}
 
Example 54
Project: openMAXIMS   File: R01VoMapper.java   Source Code and License 4 votes vote down vote up
private void populateWithOrderingProvider(IfOcsOrderVo order, ORC orc, OBR obr, ProviderSystemVo providerSystem) throws HL7Exception
{
	
	XCN orderingProvider=null;
	if (orc.getOrderingProvider(0) != null && orc.getOrderingProvider(0).getIDNumber().getValue() != null)
	{		
		orderingProvider = orc.getOrderingProvider(0);
	}
	if (orderingProvider == null)
	{
		//Need to also check OBR-16   Ordering provider  (XCN)
		if (obr.getOrderingProvider(0) != null && obr.getOrderingProvider(0).getIDNumber().getValue() != null)
		{
			orderingProvider = obr.getOrderingProvider(0);
		}
	}
	
	if (orderingProvider != null)
	{
		HcpLiteVo hcp = populateHcpVoFromXCN(orderingProvider, providerSystem.getCodeSystem());
		if (hcp != null)
		{
			order.setResponsibleClinician(hcp);
			if (!order.getOrderedByIsNotNull())  // wdev-4443
				order.setOrderedBy(hcp.getMos());
		}
		else
		{
			GpShortVo gp = populateGPVoFromXCN(orderingProvider, providerSystem.getCodeSystem());
			if (gp == null)
			{
				// We need to log the fact that the GP is not on our system
				LOG.warn("GP with code " + orderingProvider.getIDNumber() + " was not found on the IMS database");												
			}
			else
			{
				order.setResponsibleGp(gp);
			}
		}
		//WDEV-8884 
		if(ConfigFlag.HL7.REJECT_RESULTS_FOR_UNKNOWN_ORDERINGPROVIDER_OR_LOCATION.getValue())
		{
			// wdev-2746 If Neither Clinician nor GP are populated, reject the message as
			// one or the other are mandatory
			if (orderingProvider.getIDNumber().getValue() != null &&
					!order.getResponsibleClinicianIsNotNull() && !order.getResponsibleGpIsNotNull())
			{
				throw new HL7Exception("Ordering Provider (ORC-12, OBR-16) does not map to a valid Clinician or GP - Message Rejected");
			}
		}
	}

}
 
Example 55
Project: openmaxims-linux   File: R01VoMapper.java   Source Code and License 4 votes vote down vote up
private void populateWithOrderingProvider(IfOcsOrderVo order, ORC orc, OBR obr, ProviderSystemVo providerSystem) throws HL7Exception
{
	
	XCN orderingProvider=null;
	if (orc.getOrderingProvider(0) != null && orc.getOrderingProvider(0).getIDNumber().getValue() != null)
	{		
		orderingProvider = orc.getOrderingProvider(0);
	}
	if (orderingProvider == null)
	{
		//Need to also check OBR-16   Ordering provider  (XCN)
		if (obr.getOrderingProvider(0) != null && obr.getOrderingProvider(0).getIDNumber().getValue() != null)
		{
			orderingProvider = obr.getOrderingProvider(0);
		}
	}
	
	if (orderingProvider != null)
	{
		HcpLiteVo hcp = populateHcpVoFromXCN(orderingProvider, providerSystem.getCodeSystem());
		if (hcp != null)
		{
			order.setResponsibleClinician(hcp);
			if (!order.getOrderedByIsNotNull())  // wdev-4443
				order.setOrderedBy(hcp.getMos());
		}
		else
		{
			GpShortVo gp = populateGPVoFromXCN(orderingProvider, providerSystem.getCodeSystem());
			if (gp == null)
			{
				// We need to log the fact that the GP is not on our system
				LOG.warn("GP with code " + orderingProvider.getIDNumber() + " was not found on the IMS database");												
			}
			else
			{
				order.setResponsibleGp(gp);
			}
		}
		//WDEV-8884 
		if(ConfigFlag.HL7.REJECT_RESULTS_FOR_UNKNOWN_ORDERINGPROVIDER_OR_LOCATION.getValue())
		{
			// wdev-2746 If Neither Clinician nor GP are populated, reject the message as
			// one or the other are mandatory
			if (orderingProvider.getIDNumber().getValue() != null &&
					!order.getResponsibleClinicianIsNotNull() && !order.getResponsibleGpIsNotNull())
			{
				throw new HL7Exception("Ordering Provider (ORC-12, OBR-16) does not map to a valid Clinician or GP - Message Rejected");
			}
		}
	}

}
 
Example 56
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 57
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 58
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();
}