Search in sources :

Example 66 with Message

use of bind.feature.generichierarchy.case1.model.Message in project kripton by xcesco.

the class MessageListResponseBindMap method serializeOnJacksonAsString.

@Override
public int serializeOnJacksonAsString(MessageListResponse object, JsonGenerator jacksonSerializer) throws Exception {
    jacksonSerializer.writeStartObject();
    int fieldCount = 0;
    // field detailMessage (mapped with "detailMessage")
    if (object.getDetailMessage() != null) {
        fieldCount++;
        jacksonSerializer.writeStringField("detailMessage", object.getDetailMessage());
    }
    // field list (mapped with "list")
    if (object.getList() != null) {
        fieldCount++;
        int n = object.getList().size();
        Message item;
        // write wrapper tag
        jacksonSerializer.writeFieldName("list");
        if (n > 0) {
            jacksonSerializer.writeStartArray();
            for (int i = 0; i < n; i++) {
                item = object.getList().get(i);
                if (item == null) {
                    jacksonSerializer.writeString("null");
                } else {
                    if (messageBindMap.serializeOnJacksonAsString(item, jacksonSerializer) == 0) {
                        jacksonSerializer.writeNullField("list");
                    }
                }
            }
            jacksonSerializer.writeEndArray();
        } else {
            jacksonSerializer.writeString("");
        }
    }
    // field status (mapped with "status")
    if (object.getStatus() != null) {
        fieldCount++;
        jacksonSerializer.writeStringField("status", object.getStatus().toString());
    }
    jacksonSerializer.writeEndObject();
    return fieldCount;
}
Also used : Message(bind.feature.generichierarchy.case1.model.Message)

Example 67 with Message

use of bind.feature.generichierarchy.case1.model.Message in project beam by apache.

the class HL7v2IOTestUtil method testMessage.

static Message testMessage(String name) {
    Message msg = new Message();
    msg.setName(name);
    return msg;
}
Also used : Message(com.google.api.services.healthcare.v1.model.Message)

Example 68 with Message

use of bind.feature.generichierarchy.case1.model.Message in project beam by apache.

the class HL7v2MessageCoder method decode.

@Override
public HL7v2Message decode(InputStream inStream) throws CoderException, IOException {
    Message msg = new Message();
    msg.setName(STRING_CODER.decode(inStream));
    msg.setMessageType(STRING_CODER.decode(inStream));
    msg.setCreateTime(STRING_CODER.decode(inStream));
    msg.setSendTime(STRING_CODER.decode(inStream));
    msg.setData(STRING_CODER.decode(inStream));
    msg.setSendFacility(STRING_CODER.decode(inStream));
    msg.setLabels(MAP_CODER.decode(inStream));
    HL7v2Message out = HL7v2Message.fromModel(msg);
    out.setSchematizedData(STRING_CODER.decode(inStream));
    return out;
}
Also used : Message(com.google.api.services.healthcare.v1.model.Message)

Example 69 with Message

use of bind.feature.generichierarchy.case1.model.Message in project beam by apache.

the class HL7v2Message method toModel.

/**
 * To model message.
 *
 * @return the message
 */
public Message toModel() {
    Message out = new Message();
    out.setName(this.getName());
    out.setMessageType(this.getMessageType());
    out.setSendTime(this.getSendTime());
    out.setCreateTime(this.getCreateTime());
    out.setData(this.getData());
    out.setSendFacility(this.getSendFacility());
    if (this.schematizedData != null) {
        out.setSchematizedData(new SchematizedData().setData(this.schematizedData));
    }
    out.setLabels(this.labels);
    return out;
}
Also used : SchematizedData(com.google.api.services.healthcare.v1.model.SchematizedData) Message(com.google.api.services.healthcare.v1.model.Message)

Example 70 with Message

use of bind.feature.generichierarchy.case1.model.Message in project streamsx.health by IBMStreams.

the class HapiMessageHandler method processMessage.

@Override
public Message processMessage(Message theMessage, Map<String, Object> arg1) throws ReceivingApplicationException, HL7Exception {
    server.messageArrived(theMessage);
    Message ack;
    try {
        // Always use the default parser to generate an ack
        // HAPI seems to get into trouble if the ADT_AXX superstructure
        // is used.  
        // Internally, when it tries to generate an ack message
        // the super structure setting in the model class factory causes the ADT_AXX message
        // to get created instead of the ACK getting created.  This is to override the model
        // class factory so that the proper class can be generated.
        theMessage.setParser(ackParser);
        ack = theMessage.generateACK();
        return ack;
    } catch (IOException e) {
        TRACE.log(TraceLevel.ERROR, "Unable to generate ack message", e);
    }
    return theMessage;
}
Also used : Message(ca.uhn.hl7v2.model.Message) IOException(java.io.IOException)

Aggregations

Message (ca.uhn.hl7v2.model.Message)114 Test (org.junit.Test)81 BaseContextSensitiveTest (org.openmrs.test.BaseContextSensitiveTest)60 ORU_R01 (ca.uhn.hl7v2.model.v25.message.ORU_R01)30 NK1 (ca.uhn.hl7v2.model.v25.segment.NK1)21 Patient (org.openmrs.Patient)21 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)17 ORUR01Handler (org.openmrs.hl7.handler.ORUR01Handler)15 Person (org.openmrs.Person)14 ArrayList (java.util.ArrayList)13 HL7Exception (ca.uhn.hl7v2.HL7Exception)12 Concept (org.openmrs.Concept)12 Obs (org.openmrs.Obs)12 ObsService (org.openmrs.api.ObsService)11 QRD (ca.uhn.hl7v2.model.v24.segment.QRD)9 IOException (java.io.IOException)8 Encounter (org.openmrs.Encounter)8 RouteBuilder (org.apache.camel.builder.RouteBuilder)7 Structure (ca.uhn.hl7v2.model.Structure)5 CX (ca.uhn.hl7v2.model.v25.datatype.CX)5