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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations