Skip to content

Instantly share code, notes, and snippets.

REQUEST:
<request source="EMA_4_0" portalID="1" pformat="pcl" wformat="html" output="inline">
<rxNumber>rx_encrypted_id</rxNumber>
<productRxNorm>830648</productRxNorm>
<productNDC>00093092606</productNDC>
<quantity>10</quantity>
<patient>
<code>ABC123</code>
<firstName>John</firstName>
@rkroll
rkroll / gist:286bd48c5c723fe5eccc
Created May 22, 2014 16:16
LDM request/response
22 May 12:15:48,532 DEBUG org.apache.http.impl.conn.SingleClientConnManager:212 - Get connection for route HttpRoute[{s}->https://scriptguidetest.ldmgrp.com] -
22 May 12:15:48,686 DEBUG org.apache.http.impl.conn.DefaultClientConnectionOperator:145 - Connecting to scriptguidetest.ldmgrp.com/67.221.232.152:443 -
22 May 12:15:49,056 DEBUG org.apache.http.client.protocol.RequestAddCookies:132 - CookieSpec selected: best-match -
22 May 12:15:49,064 DEBUG org.apache.http.client.protocol.RequestAuthCache:75 - Auth cache not set in the context -
22 May 12:15:49,064 DEBUG org.apache.http.impl.client.DefaultRequestDirector:631 - Attempt 1 to execute request -
22 May 12:15:49,064 DEBUG org.apache.http.impl.conn.DefaultClientConnection:264 - Sending request: POST /remotebridge.aspx HTTP/1.1 -
22 May 12:15:49,065 DEBUG org.apache.http.impl.conn.Wire:63 - >> "POST /remotebridge.aspx HTTP/1.1[\r][\n]" -
22 May 12:15:49,066 DEBUG org.apache.http.impl.conn.Wire:63 - >> "Content-Length: 588[\r][\n]" -
22 May 12:15:49,0
@rkroll
rkroll / gist:016814536d34fc0f2f97
Created May 27, 2014 18:29
Sprint Transaction + ApplicationEventPublisher
public <T extends ApplicationEvent> void publishEvent(final T event) {
if (TransactionSynchronizationManager.isActualTransactionActive()) {
TransactionSynchronizationManager.registerSynchronization(
new TransactionSynchronizationAdapter() {
@Override
public void afterCommit() {
delegate.publishEvent(event);
}
});
}
!# /usr/bin/env sh
du -s ./* | sort -n| cut -f 2-| xargs du -sh {}
@rkroll
rkroll / beanValidationExample
Created June 11, 2014 19:06
Bean Validation Example
public class User {
@NotNull
@Email
private String email;
@ValidUsername
private String username;
@NotNull
private String name;
@rkroll
rkroll / TruncatedBinaryBackoff
Created June 19, 2014 18:38
twitter TruncatedBinaryBackoff
// =================================================================================================
// Copyright 2011 Twitter, Inc.
// -------------------------------------------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this work except in compliance with the License.
// You may obtain a copy of the License in the LICENSE file, or at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
@rkroll
rkroll / gist:f5fafbb42b2fca101333
Created August 28, 2014 15:20
funky java date
@Test
public void testDate() {
{
Date date = new Date(1325376000000l);
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("US/Eastern"));
cal.setTime(date);
cal.set(Calendar.MONTH, Calendar.JANUARY);
Date timeDate = cal.getTime();
System.out.println(timeDate);
}
@rkroll
rkroll / Histogram Oddness
Created December 16, 2010 18:12
Displays the histogram oddness on dates
// delete the index
curl -XDELETE 'http://localhost:9200/test/'
// create index
curl -XPUT 'http://localhost:9200/test/' -d '
{
index : {
number_of_shards : 5,
number_of_replicas : 0
@rkroll
rkroll / query_string_double_quote
Created December 21, 2010 20:17
Query search string containing non-closed double quote
[2010-12-21 15:15:46,708][DEBUG][action.search.type ] [Oracle] [redflag][14], node[BIjCua6SR8CUaN6YRSKruw], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@704c98f1]
java.lang.ArrayIndexOutOfBoundsException: 549
at org.elasticsearch.common.Unicode.UTF8toUTF16(Unicode.java:188)
at org.elasticsearch.common.Unicode.unsafeFromBytesAsUtf16(Unicode.java:104)
at org.elasticsearch.common.Unicode.fromBytes(Unicode.java:78)
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:416)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:335)
at org.elasticsearch.search.SearchService.executeDfsPhase(SearchService.java:153)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteDfs(SearchServiceTransportAction.java:101)
at org.elasticsearch.action.search.type.TransportSearchDfsQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchDfsQueryThenFetchAction.java:82)
@rkroll
rkroll / gist:1097269
Created July 21, 2011 14:09
VendorSearchCallback
public interface VendorQueryCallback extends ClientCallback<SearchResponse>{
ActionFuture<SearchResponse> execute(final Client client);
}
public class VendorQueryCallbackImpl implements VendorQueryCallback {
private final VendorSearchQuery query;
public VendorQueryCallbackImpl(VendorSearchQuery query) {
this.query = query;