本文整理汇总了Java中ca.uhn.hl7v2.model.v26.segment.MSH类的典型用法代码示例。如果您正苦于以下问题:Java MSH类的具体用法?Java MSH怎么用?Java MSH使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MSH类属于ca.uhn.hl7v2.model.v26.segment包,在下文中一共展示了MSH类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: fillMsh
import ca.uhn.hl7v2.model.v26.segment.MSH; //导入依赖的package包/类
/**
* @param msh
* @param dateOfMessage
* @param clinicName
* @param messageCode i.e. "REF"
* @param triggerEvent i.e. "I12"
* @param messageStructure i.e. "REF_I12"
* @param hl7VersionId is the version of hl7 in use, i.e. "2.6"
*/
public static void fillMsh(MSH msh, Date dateOfMessage, String clinicName, String messageCode, String triggerEvent, String messageStructure, String hl7VersionId) throws DataTypeException {
msh.getFieldSeparator().setValue("|");
msh.getEncodingCharacters().setValue("^~\\&");
msh.getVersionID().getVersionID().setValue(hl7VersionId);
msh.getDateTimeOfMessage().setValue(getAsHl7FormattedString(dateOfMessage));
msh.getSendingApplication().getNamespaceID().setValue("OSCAR");
msh.getSendingFacility().getNamespaceID().setValue(clinicName);
// message code "REF", event "I12", structure "REF I12"
msh.getMessageType().getMessageCode().setValue(messageCode);
msh.getMessageType().getTriggerEvent().setValue(triggerEvent);
msh.getMessageType().getMessageStructure().setValue(messageStructure);
}
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:26,代码来源:DataTypeUtils.java
示例2: fillMsh
import ca.uhn.hl7v2.model.v26.segment.MSH; //导入依赖的package包/类
/**
* @param msh
* @param dateOfMessage
* @param facilityName facility.getName();
* @param messageCode i.e. "REF"
* @param triggerEvent i.e. "I12"
* @param messageStructure i.e. "REF_I12"
* @param hl7VersionId is the version of hl7 in use, i.e. "2.6"
*/
public static void fillMsh(MSH msh, Date dateOfMessage, String clinicName, String messageCode, String triggerEvent, String messageStructure, String hl7VersionId) throws DataTypeException {
msh.getFieldSeparator().setValue("|");
msh.getEncodingCharacters().setValue("^~\\&");
msh.getVersionID().getVersionID().setValue(hl7VersionId);
msh.getDateTimeOfMessage().setValue(getAsHl7FormattedString(dateOfMessage));
msh.getSendingApplication().getNamespaceID().setValue("OSCAR");
msh.getSendingFacility().getNamespaceID().setValue(clinicName);
// message code "REF", event "I12", structure "REF I12"
msh.getMessageType().getMessageCode().setValue(messageCode);
msh.getMessageType().getTriggerEvent().setValue(triggerEvent);
msh.getMessageType().getMessageStructure().setValue(messageStructure);
}
开发者ID:oscarservice,项目名称:oscar-old,代码行数:26,代码来源:DataTypeUtils.java
示例3: getSender
import ca.uhn.hl7v2.model.v26.segment.MSH; //导入依赖的package包/类
@Override
public String getSender() throws ElexisException{
String sender;
try {
MSH msh = (MSH) message.get("MSH");
sender = msh.getMsh4_SendingFacility().getNamespaceID().getValue();
if (sender == null) {
sender = msh.getMsh3_SendingApplication().getNamespaceID().getValue();
if (sender == null) {
sender = "";
}
}
} catch (HL7Exception e) {
throw new ElexisException(e.getMessage(), e);
}
return sender;
}
开发者ID:elexis,项目名称:elexis-3-core,代码行数:18,代码来源:HL7ReaderV26.java
示例4: processMessage
import ca.uhn.hl7v2.model.v26.segment.MSH; //导入依赖的package包/类
@Override
public Message processMessage(Message hapiMsg) {
System.out.println("#################################");
System.out.println("#################################");
System.out.println("#################################");
System.out.println("#################################");
System.out.println("I got a v26 HAPI message");
ADT_A01 adtMsg = (ADT_A01)hapiMsg;
MSH msh = adtMsg.getMSH();
XPN[] xpns = adtMsg.getPID().getPatientName();
for (XPN xpn : xpns) {
System.out.println(xpn.toString());
} return null; }
开发者ID:springframeworkguru,项目名称:hapi-spring-integration,代码行数:16,代码来源:HL7v26InboundMessageServiceImpl.java
示例5: createSendingFacilityElement
import ca.uhn.hl7v2.model.v26.segment.MSH; //导入依赖的package包/类
private Element createSendingFacilityElement(Document doc, MSH msh) throws HL7Exception {
Element elemFacility = doc.createElement("Sending_Facility");
elemFacility.setAttribute("idLocal", msh.getMsh4_SendingFacility().getHd1_NamespaceID().getValueOrEmpty());
if (msh.getMsh4_SendingFacility().getHd2_UniversalID().isEmpty()) {
elemFacility.setAttribute("idUniversal", msh.getMsh4_SendingFacility().getHd2_UniversalID()
.getValueOrEmpty());
}
if (msh.getMsh4_SendingFacility().getHd3_UniversalIDType().isEmpty()) {
elemFacility.setAttribute("idUniversalType", msh.getMsh4_SendingFacility().getHd3_UniversalIDType()
.getValueOrEmpty());
}
return elemFacility;
}
开发者ID:sll-mdilab,项目名称:t5-doc,代码行数:15,代码来源:PCD_01MessageToXMLConverter.java
示例6: createSendingApplicationElement
import ca.uhn.hl7v2.model.v26.segment.MSH; //导入依赖的package包/类
private Element createSendingApplicationElement(Document doc, MSH msh) throws HL7Exception {
Element elemApp = doc.createElement("Sending_Application");
String messageSenderLocalID = msh.getMsh3_SendingApplication().getHd1_NamespaceID().getValueOrEmpty();
elemApp.setAttribute("idLocal", messageSenderLocalID);
if (msh.getMsh3_SendingApplication().getHd2_UniversalID().isEmpty()) {
String messageSenderGlobalID = msh.getMsh3_SendingApplication().getHd2_UniversalID().getValueOrEmpty();
elemApp.setAttribute("idUniversal", messageSenderGlobalID);
}
if (msh.getMsh3_SendingApplication().getHd3_UniversalIDType().isEmpty())
elemApp.setAttribute("idUniversalType", msh.getMsh3_SendingApplication().getHd3_UniversalIDType()
.getValueOrEmpty());
return elemApp;
}
开发者ID:sll-mdilab,项目名称:t5-doc,代码行数:15,代码来源:PCD_01MessageToXMLConverter.java
示例7: getMsh
import ca.uhn.hl7v2.model.v26.segment.MSH; //导入依赖的package包/类
public MSH getMsh() {
return chainnedMessageAdapter.getMsh();
}
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:4,代码来源:OscarToOscarHl7V2Handler.java
示例8: getMsh
import ca.uhn.hl7v2.model.v26.segment.MSH; //导入依赖的package包/类
@Override
public MSH getMsh() {
return (hl7Message.getMSH());
}
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:5,代码来源:RefI12Handler.java
示例9: createRootElement
import ca.uhn.hl7v2.model.v26.segment.MSH; //导入依赖的package包/类
private Element createRootElement(Document doc, MSH msh) throws DataTypeException {
Element root = doc.createElementNS(T5_XML_NAMESPACE, "PCD_01_Message");
root.setAttribute("id", msh.getMsh10_MessageControlID().getValueOrEmpty());
root.setAttribute("timeStamp", convertDtmToXmlDate(msh.getMsh7_DateTimeOfMessage()));
return root;
}
开发者ID:sll-mdilab,项目名称:t5-doc,代码行数:7,代码来源:PCD_01MessageToXMLConverter.java
示例10: getMSH
import ca.uhn.hl7v2.model.v26.segment.MSH; //导入依赖的package包/类
public MSH getMSH() {
// TODO Auto-generated method stub
return message.getMSH();
}
开发者ID:AINLAB,项目名称:OHP-M2M,代码行数:5,代码来源:F11073THL7String.java
示例11: SetMSH
import ca.uhn.hl7v2.model.v26.segment.MSH; //导入依赖的package包/类
private void SetMSH(String sendingApp, String seqNum) throws HL7Exception, IOException{
MSH segMSH = m_Msg.getMSH();
segMSH.getSendingApplication().getNamespaceID().setValue(sendingApp);
segMSH.getSequenceNumber().setValue(seqNum);
}
开发者ID:AINLAB,项目名称:OHP-M2M,代码行数:6,代码来源:PCD01.java
示例12: Enviar
import ca.uhn.hl7v2.model.v26.segment.MSH; //导入依赖的package包/类
public boolean Enviar() throws HL7Exception, LLPException, IOException{
int num=0;
for(RecepcionPrestaciones rp : this.recepcion.getRecepcionPrestaciones()){
//Se crea un tipo de dato segun el mensaje, en este caso ORM^O01
ORM_O01 orm = new ORM_O01();
/***************************************************************************************************************/
MSH MSH = orm.getMSH();
MSH.getFieldSeparator().setValue("|");
MSH.getEncodingCharacters().setValue("^~\\&");
MSH.getSendingApplication().getNamespaceID().setValue("EIMSRISV1");
MSH.getSendingFacility().getNamespaceID().setValue(""+this.getRecepcion().getDerivador().getId());
MSH.getDateTimeOfMessage().getDay();
MSH.getMessageType().getMessageCode().setValue("ORM");
MSH.getMessageType().getTriggerEvent().setValue("O01");
MSH.getMessageControlID().setValue(""+this.getRecepcion().getId());
MSH.getProcessingID().getProcessingID().setValue("P");
MSH.getVersionID().getVersionID().setValue("2.6");
ORM_O01_PATIENT PAT = orm.getPATIENT();
PAT.getPID().getSetIDPID();
PAT.getPID().getPatientID().getIDNumber().setValue(this.getRecepcion().getPaciente().getRUN());
PAT.getPID().insertPid3_PatientIdentifierList(0).getCx1_IDNumber().setValue(""+this.getRecepcion().getPaciente().getId());
PAT.getPID().getPatientName(0).getFamilyName().getSurname().setValue(this.getRecepcion().getPaciente().getAPaterno()+
" "+this.getRecepcion().getPaciente().getAMaterno());
PAT.getPID().getPatientName(0).getGivenName().setValue(this.getRecepcion().getPaciente().getNombre());
//PAT.getPID().getDateTimeOfBirth().setValue(this.getRecepcion().getPaciente().getFechaNacimiento().toString("yyyyMMdd"));
PAT.getPID().getAdministrativeSex().setValue(this.getRecepcion().getPaciente().getSexo());
PAT.getPID().getPatientAddress(0).getStreetAddress().getStreetOrMailingAddress().setValue(this.getRecepcion().getPaciente().getDireccion());
PAT.getPID().getPatientAddress(0).getCity().setValue(this.getRecepcion().getPaciente().getCiudad().getDescripcion());
ORM_O01_ORDER segmentoORDEN = orm.getORDER();
segmentoORDEN.getORC().getOrc1_OrderControl().setValue("NW");
segmentoORDEN.getORC().getPlacerOrderNumber().getEntityIdentifier().setValue(""+rp.getResponsable().getId());
segmentoORDEN.getORC().getFillerOrderNumber().getEntityIdentifier().setValue(rp.getPrestacion().getId());
segmentoORDEN.getORC().getEnteredBy(0).getIDNumber().setValue(this.getRecepcion().getUsuario());
segmentoORDEN.getORC().getOrderingProvider(0).getIDNumber().setValue(this.getRecepcion().getResponsable().getIniciales());
segmentoORDEN.getORC().getOrderingProvider(0).getFamilyName().getSurname().setValue(this.getRecepcion().getResponsable().getAPaterno());
segmentoORDEN.getORC().getOrderingProvider(0).getGivenName().setValue(this.getRecepcion().getResponsable().getNombre());
segmentoORDEN.getORC().getOrderingProvider(0).getPrefixEgDR().setValue(this.getRecepcion().getResponsable().getProfesion().getAbreviacion());
segmentoORDEN.getORC().getEntererSLocation().getPointOfCare().setValue(""+this.getRecepcion().getIDCitacion());
ORM_O01_ORDER_DETAIL segmentoORDEND = orm.getORDER().getORDER_DETAIL();
segmentoORDEND.getOBR().getObr2_PlacerOrderNumber().getEi1_EntityIdentifier().setValue("EIMSRIS");
segmentoORDEND.getOBR().getObr4_UniversalServiceIdentifier().getText().setValue(rp.getPrestacion().getDescripcion());
segmentoORDEND.getOBR().getObr4_UniversalServiceIdentifier().getNameOfCodingSystem().setValue(""+
rp.getPrestacion().getRRFFxDefecto().getId());
segmentoORDEND.getOBR().getObr4_UniversalServiceIdentifier().getAlternateIdentifier().setValue(rp.getPrestacion().getDescripcion());
segmentoORDEND.getOBR().getObr18_PlacerField1().setValue(""+this.getRecepcion().getId());
segmentoORDEND.getOBR().getObr19_PlacerField2().setValue(this.getRecepcion().getId()+""+rp.getPrestacion().getId());
segmentoORDEND.getOBR().getObr20_FillerField1().setValue(rp.getPrestacion().getId());
segmentoORDEND.getOBR().getObr24_DiagnosticServSectID().setValue(rp.getPrestacion().getRRFFxDefecto().getModalidad().getDescripcion());
segmentoORDEND.getOBR().getObr44_ProcedureCode().getText().setValue(rp.getPrestacion().getDescripcion());
segmentoORDEND.getOBR().getObr44_ProcedureCode().getCne1_Identifier().setValue(rp.getPrestacion().getId());
segmentoORDEN.getMessage().addNonstandardSegment("ZDS");
Terser t = new Terser(orm);
t.set("ZDS-1-1","1.2.826.0.1.3680043.9.88");
Parser parser = new PipeParser();
String encodedMessage = parser.encode(orm);
String original = "áàäéèëíìïóòöúùuñÁÀÄÉÈËÍÌÏÓÒÖÚÙÜÑçÇ";
String ascii = "aaaeeeiiiooouuunAAAEEEIIIOOOUUUNcC";
String output = encodedMessage;
for (int i=0; i<original.length(); i++) {
output = output.replace(original.charAt(i), ascii.charAt(i));
}
System.out.println("Printing ER7 Encoded Message:");
System.out.println(output);
Parser p = new GenericParser();
Message adt = parser.parse(output);
ConnectionHub connectionHub = ConnectionHub.getInstance();
// A connection object represents a socket attached to an HL7 server
Connection connection = connectionHub.attach("localhost", port, new PipeParser(), MinLowerLayerProtocol.class);
// The initiator is used to transmit unsolicited messages
Initiator initiator = connection.getInitiator();
Message response = initiator.sendAndReceive(adt);
String responseString = parser.encode(response);
System.out.println("Received response:\n" + responseString);
// Close the connection
//....
connection.close();
//connection2.close();
num++;
}
return false;
}
开发者ID:avenda,项目名称:miniRIS,代码行数:82,代码来源:HL7Message.java
示例13: fillMSH
import ca.uhn.hl7v2.model.v26.segment.MSH; //导入依赖的package包/类
/**
* Fills MSH segment
*
* @param msh
* @param patient
*/
protected void fillMSH(final MSH msh, final String messageId, final String event,
final HL7Mandant mandant, final String uniqueMessageControlID,
final String uniqueProcessingID, final HL7Patient patient) throws DataTypeException{
msh.getMsh1_FieldSeparator().setValue("|"); //$NON-NLS-1$
msh.getMsh2_EncodingCharacters().setValue("^~\\&"); //$NON-NLS-1$
// Name der sendenden Anwendung. Dessen Eindeutigkeit im Kommunikations-Netzwerk liegt
// in der Verantwortung des jeweiligen Systemadministrators. Nimm diesen Text: CHELEXIS
msh.getMsh3_SendingApplication().getHd1_NamespaceID().setValue(this.sendingApplication1); //$NON-NLS-1$
if (this.sendingApplication3 != null) {
msh.getMsh3_SendingApplication().getHd2_UniversalID().setValue(""); //$NON-NLS-1$
msh.getMsh3_SendingApplication().getHd3_UniversalIDType()
.setValue(this.sendingApplication3); //$NON-NLS-1$
}
// Name der sendenden Institution. Optional (Beschreibung gemäss HL7 Standard).
// Gemäss HD Type Definition von HL7 folgendermassen:
// <mandantenkürzel>^<EAN des Mandanten>^L Beispiel: mf7601234567890^L
msh.getMsh4_SendingFacility().getHd1_NamespaceID().setValue(mandant.getLabel());
msh.getMsh4_SendingFacility().getHd2_UniversalID().setValue(mandant.getEan());
msh.getMsh4_SendingFacility().getHd3_UniversalIDType().setValue("L"); //$NON-NLS-1$
// Name der empfangenden Anwendung. Eindeutigkeit dito MSH.3
// MSH-5: IMED
msh.getMsh5_ReceivingApplication().getHd1_NamespaceID()
.setValue(this.receivingApplication1);
if (this.receivingApplication3 != null) {
msh.getMsh5_ReceivingApplication().getHd2_UniversalID().setValue(""); //$NON-NLS-1$
msh.getMsh5_ReceivingApplication().getHd3_UniversalIDType()
.setValue(this.receivingApplication3); //$NON-NLS-1$
}
// Name der empfangenden Institution . Optional (Beschreibung gemäss HL7 Standard).
// Vergleiche auch MSH.5
// MSH-6: PRAXIS
msh.getMsh6_ReceivingFacility().getHd1_NamespaceID().setValue(this.receivingFacility);
msh.getMsh7_DateTimeOfMessage().setValue(HL7Helper.dateToString(new Date()));
msh.getMsh8_Security().setValue(""); //$NON-NLS-1$
msh.getMsh9_MessageType().getMessageCode().setValue(messageId);
msh.getMsh9_MessageType().getTriggerEvent().setValue(event);
msh.getMsh9_MessageType().getMessageStructure().setValue(""); //$NON-NLS-1$
// Eindeutige Nachrichtennummer: GUID
if (uniqueMessageControlID != null) {
msh.getMsh10_MessageControlID().setValue(uniqueMessageControlID);
}
if (uniqueProcessingID != null) {
msh.getMsh11_ProcessingID().getPt1_ProcessingID().setValue(uniqueProcessingID);
}
msh.getMsh12_VersionID().getVid1_VersionID().setValue(getVersion());
}
开发者ID:elexis,项目名称:elexis-3-core,代码行数:53,代码来源:HL7Writer.java
示例14: getXML
import ca.uhn.hl7v2.model.v26.segment.MSH; //导入依赖的package包/类
public Document getXML(Message msg) {
try {
long start_ts = System.currentTimeMillis();
logger.info(msg.getClass().getSimpleName());
ORU_R01 msgORU = (ORU_R01) msg;
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
MSH msh = msgORU.getMSH();
Element root = createRootElement(doc, msh);
doc.appendChild(root);
root.appendChild(createSendingApplicationElement(doc, msh));
root.appendChild(createSendingFacilityElement(doc, msh));
handlePatientResults(msgORU, doc, root);
long end_ts = System.currentTimeMillis();
logger.info("XML conversion took " + (end_ts - start_ts) + " millisec");
return doc;
} catch (HL7Exception | DOMException | ParserConfigurationException e) {
throw new T5ConversionException(e);
}
}
开发者ID:sll-mdilab,项目名称:t5-doc,代码行数:30,代码来源:PCD_01MessageToXMLConverter.java
示例15: getMsh
import ca.uhn.hl7v2.model.v26.segment.MSH; //导入依赖的package包/类
public abstract MSH getMsh();
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:2,代码来源:ChainnedMessageAdapter.java
注:本文中的ca.uhn.hl7v2.model.v26.segment.MSH类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论