本文整理汇总了Java中ca.uhn.hl7v2.parser.Parser.encode方法的典型用法代码示例。如果您正苦于以下问题:Java Parser.encode方法的具体用法?Java Parser.encode怎么用?Java Parser.encode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca.uhn.hl7v2.parser.Parser
的用法示例。
在下文中一共展示了Parser.encode方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createText
import ca.uhn.hl7v2.parser.Parser; //导入方法依赖的package包/类
/**
* Creates an OMG_O19 message
*
* @param patient
* @param kostentraeger
* @param rechnungsempfaenger
* @param auftragsNummer
* @param plan
* Abrechnungssystem (MV, UVG, VVG, KVG, usw)
* @param beginDate
* @param vnr
* Versicherungs-, Fall- oder Unfallnr
* @return
*/
public String createText(final HL7Patient patient, final HL7Kostentraeger rechnungsempfaenger,
final HL7Kostentraeger kostentraeger, final String plan, final Date beginDate,
final String fallNr, final long auftragsNummer) throws DataTypeException, HL7Exception{
OML_O21 omg = new OML_O21();
fillMSH(omg.getMSH(), "OML", "O21", mandant, this.uniqueMessageControlID, //$NON-NLS-1$ //$NON-NLS-2$
this.uniqueProcessingID, patient); //$NON-NLS-1$ //$NON-NLS-2$
fillPID(omg.getPATIENT().getPID(), patient);
fillNK1(omg.getPATIENT().getNK1(), rechnungsempfaenger);
fillPV1(omg.getPATIENT().getPATIENT_VISIT().getPV1(), patient, beginDate);
fillIN1(omg.getPATIENT().getINSURANCE().getIN1(), patient, kostentraeger, plan, fallNr);
fillORC(omg.getORDER().getORC(), "1", auftragsNummer); //$NON-NLS-1$
// Now, let's encode the message and look at the output
Parser parser = new PipeParser();
return parser.encode(omg);
}
示例2: createText
import ca.uhn.hl7v2.parser.Parser; //导入方法依赖的package包/类
/**
* Creates an ORU_R01 message
*
* @param patient
* @param labItem
* @param labwert
*
* @return
*/
public String createText(final HL7Patient patient, final HL7LaborItem labItem,
final HL7LaborWert labwert) throws DataTypeException, HL7Exception{
ORU_R01 oru = new ORU_R01();
// Message
fillMSH(oru.getMSH(), "ORU", "R01", mandant, this.uniqueMessageControlID, //$NON-NLS-1$ //$NON-NLS-2$
this.uniqueProcessingID, patient); //$NON-NLS-1$ //$NON-NLS-2$
// Patient
PID pid = oru.getPATIENT_RESULT().getPATIENT().getPID();
fillPID(pid, patient);
ORU_R01_ORDER_OBSERVATION orderObservation = oru.getPATIENT_RESULT().getORDER_OBSERVATION();
fillORC(orderObservation.getORC(), "RE", null); //$NON-NLS-1$
addResultInternal(oru, patient, labItem, labwert, 0);
// Now, let's encode the message and look at the output
Parser parser = new PipeParser();
return parser.encode(oru);
}
示例3: addResultInternal
import ca.uhn.hl7v2.parser.Parser; //导入方法依赖的package包/类
/**
* Adds a ORU_R01 observation result
*
* @param oru
* @param patient
* @param labItem
* @param labwert
* @param initial
* @return
*/
private String addResultInternal(final ORU_R01 oru, final HL7Patient patient,
final HL7LaborItem labItem, final HL7LaborWert labwert, int orderObservationIndex)
throws DataTypeException, HL7Exception{
// Observation
ORU_R01_ORDER_OBSERVATION orderObservation =
(ORU_R01_ORDER_OBSERVATION) oru.getPATIENT_RESULT().getORDER_OBSERVATION(
orderObservationIndex);
fillOBR(orderObservation.getOBR(), orderObservationIndex, labItem);
fillOBX(orderObservation.getOBSERVATION().getOBX(), patient, labItem, labwert);
if (labwert.getKommentar() != null && labwert.getKommentar().length() > 0) {
fillNTE(orderObservation.getNTE(), labwert);
}
// Now, let's encode the message and look at the output
Parser parser = new PipeParser();
return parser.encode(oru);
}
示例4: validHL7IsConvertedAndAckIsSent
import ca.uhn.hl7v2.parser.Parser; //导入方法依赖的package包/类
@Ignore
@Test
@DirtiesContext
public void validHL7IsConvertedAndAckIsSent() throws Exception {
standardHL7XMLEndpoint.expectedMessageCount(1);
t5XMLEndpoint.expectedMessageCount(1);
String hl7Input = "MSH|^~\\&|SendingApplication|SendingFacility|ReceivingApplication|ReceivingFacility|20120530112345||ORU^R01^ORU_R01|9879790003|P|2.6|||NE|AL|USA|ASCII|EN^English^ISO639||IHE_PCD_ORU_R01^IHE PCD^1.3.6.1.4.1.19376.1.6.1.1.1^ISO\r"
+ "PID|||HO2009001^^^NIST^PI||Hon^Albert^^^^^L|Adams^^^^^^L|19610101|M|||15 N Saguaro^^Tucson^AZ^85701\r"
+ "PV1||I|ICU^2^23\r"
+ "OBR|1|||44616-1^Pulse oximetry panel ^LN|||20120512031234||||||||||||||||||F|||||||||||||||||||252465000^Pulse oximetry^SCT|7087005^Intermittent^SCT\r"
+ "NTE|1||This comment refers to all the results in the battery\r"
+ "OBX|1|NM|8889-8^Heart Rate by Oximetry^LN^149530^ MDC_PULS_OXIM_PULS_RATE^MDC|1.11.2.3|55|{beats}/min^beats per minute^UCUM|35-125||99||R|||20120530112340|||AMEAS^auto-measurement^MDC|0123456789ABCDEF^Pulse_Oximeter_Vendor_X^0123456789ABCDEF^EUI-64||49521004^left ear structure^SCT\n"
+ "NTE|1||This is a comment about pulse";
Parser parser = new PipeParser();
ORU_R01 originalMessage = (ORU_R01)parser.parse(hl7Input);
String encodedHL7 = parser.encode(originalMessage);
String response = minaTemplate.requestBody((Object)encodedHL7, String.class);
ACK responseMessage = (ACK)parser.parse(response);
assertEquals(AcknowledgmentCode.AA.name(), responseMessage.getMSA().getAcknowledgmentCode().getValue());
standardHL7XMLEndpoint.assertIsSatisfied();
t5XMLEndpoint.assertIsSatisfied();
ORU_R01 outputStandardXMLMessage = (ORU_R01)parseXMLExchange(standardHL7XMLEndpoint.getReceivedExchanges().get(0));
assertEquals(originalMessage.getMSH().getMessageType().getName(), outputStandardXMLMessage.getMSH().getMessageType().getName());
assertEquals(originalMessage.getMSH().getMessageControlID().getValue(), outputStandardXMLMessage.getMSH().getMessageControlID().getValue());
}
示例5: constructQBP_Q21
import ca.uhn.hl7v2.parser.Parser; //导入方法依赖的package包/类
public String constructQBP_Q21(String correlationId, ResolvePatientIdentifier msg) throws HL7Exception {
QBP_Q21 qbp_q21 = new QBP_Q21();
Terser t = new Terser(qbp_q21);
constructBasicMSHSegment(correlationId, t);
t.set("MSH-9-1", "QBP");
t.set("MSH-9-2", "Q23");
t.set("MSH-9-3", "QBP_Q21");
t.set("QPD-1-1", "IHE PIX Query");
t.set("QPD-2", UUID.randomUUID().toString());
t.set("QPD-3-1", msg.getIdentifier().getIdentifier());
t.set("QPD-3-4", msg.getIdentifier().getAssigningAuthority().getAssigningAuthority());
t.set("QPD-3-4-2", msg.getIdentifier().getAssigningAuthority().getAssigningAuthorityId());
t.set("QPD-3-4-3", "ISO");
t.set("QPD-3-5", "PI");
t.set("QPD-4-4", msg.getTargetAssigningAuthority().getAssigningAuthority());
t.set("QPD-4-4-2", msg.getTargetAssigningAuthority().getAssigningAuthorityId());
t.set("QPD-4-4-3", "ISO");
t.set("QPD-4-5", "PI");
t.set("RCP-1", "I");
Parser p = new GenericParser();
return p.encode(qbp_q21);
}
示例6: constructADT_A04
import ca.uhn.hl7v2.parser.Parser; //导入方法依赖的package包/类
public String constructADT_A04(String correlationId, RegisterNewPatient msg) throws HL7Exception {
ADT_A01 adt_a04 = new ADT_A01();
Terser t = new Terser(adt_a04);
constructBasicMSHSegment(correlationId, t);
t.set("MSH-9-1", "ADT");
t.set("MSH-9-2", "A04");
t.set("MSH-9-3", "ADT_A01");
t.set("EVN-2", dateFormatDay.format(new Date()));
for (int i=0; i<msg.getPatientIdentifiers().size(); i++) {
t.set("PID-3(" + i + ")-1", msg.getPatientIdentifiers().get(i).getIdentifier());
t.set("PID-3(" + i + ")-4", msg.getPatientIdentifiers().get(i).getAssigningAuthority().getAssigningAuthority());
t.set("PID-3(" + i + ")-4-2", msg.getPatientIdentifiers().get(i).getAssigningAuthority().getAssigningAuthorityId());
t.set("PID-3(" + i + ")-4-3", msg.getPatientIdentifiers().get(i).getAssigningAuthority().getAssigningAuthorityIdType());
}
t.set("PID-5-1", msg.getFamilyName());
t.set("PID-5-2", msg.getGivenName());
t.set("PID-7", msg.getBirthDate());
t.set("PID-8", msg.getGender());
t.set("PID-13", msg.getTelecom());
t.set("PID-15", msg.getLanguageCommunicationCode());
t.set("PV1-2", "O");
Parser p = new GenericParser();
return p.encode(adt_a04);
}
示例7: encode
import ca.uhn.hl7v2.parser.Parser; //导入方法依赖的package包/类
static String encode(Message message, Parser parser) throws HL7Exception {
return parser.encode(message);
}
示例8: Enviar
import ca.uhn.hl7v2.parser.Parser; //导入方法依赖的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;
}
示例9: encode
import ca.uhn.hl7v2.parser.Parser; //导入方法依赖的package包/类
static String encode(Message message, Parser parser)
throws HL7Exception
{
return parser.encode(message);
}