Results-Only Interface with Quest via SOAP / HL7

By: Johnathon Wright on: February 20, 2014

Just as a note, SOAP is not only very painful to use, but it's a system that uses HTTP, but ignores all the value you get from HTTP. There are dramatically better options. Check out Designing Hypermedia APIs by Steve Klabnik.

I acknowledge that there is some value is being able to validate messages. But it doesn't, IMO, make up for the pain of implementation.

Get Results ( HL7 w/ Embedded PDF )

I'm using the action 'get_results' with parameters like this:

 'resultsRequest' =>
        'startDate' => self.start_date.to_date.to_s(:mdy),
        'endDate' => self.end_date.to_date.to_s(:mdy),
        'maxMessages' => 30,
        'providerAccounts' => 'THO',
        'retrieveFinalsOnly' => 'false'

and the request looks like this:

SOAP request:
SOAPAction: "getResults"
Content-Type: text/xml;charset=UTF-8
Content-Length: 828

<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="" xmlns:xsi="" xmlns:wsdl="" xmlns:env="" xmlns:ins0="java:com.medplus.serviceHub.results.webservice" xmlns:ins1="java:com.medplus.serviceHub.results.webservice.printable" xmlns:ins2="java:javax.xml.rpc" xmlns:ins3="java:javax.xml.soap" xmlns:ins4="java:language_builtins.lang"><env:Body><getResults><wsdl:resultsRequest><wsdl:startDate>08/01/2013</wsdl:startDate> wsdl:endDate>09/01/2013</wsdl:endDate><wsdl:maxMessages>30</wsdl:maxMessages><wsdl:providerAccounts>THO</wsdl:providerAccounts> <wsdl:retrieveFinalsOnly>false</wsdl:retrieveFinalsOnly></wsdl:resultsRequest></getResults></env:Body></env:Envelope>

response looks like this:

<?xml version="1.0"?>
    <env:Envelope xmlns:soapenc="" xmlns:xsd="" xmlns:env="" xmlns:xsi="">
    <env:Body env:encodingStyle="">
      <m:getResultsResponse xmlns:m="">
        <result xmlns:n1="java:com.medplus.serviceHub.results.webservice" xsi:type="n1:ResultsResponse">
          <HL7Messages soapenc:arrayType="xsd:string[2]">
            <string xsi:type="xsd:string">MSH|^~\&|LAB|QTE||12345|20130404215632||ORU^R01|80000000000000053080|D|2.3.1
  CULTURE|||20130404093200|||||||20130404083500||1122334455^ALLEN^JOSEPH^^^^^^^^^^NPI|||||CB^Quest Diagnostics-Wood Dale^1355 Mittel Blvd^Wood Dale^IL^60191-1024^Anthony V Thomas, M.D.|20130805171655|||F
  OBX|1|ST|5778-6^Color Ur^LN^30005500^COLOR^QDIWDL||AMBER||YELLOW|A|||F|||20130805171655|CB
  OBX|2|ST|5767-9^Appearance Ur^LN^30005600^APPEARANCE^QDIWDL||TURBID||CLEAR|A|||F|||20130805171655|CB
  OBX|3|NM|5811-5^Sp Gr Ur Strip^LN^30006000^SPECIFIC GRAVITY^QDIWDL||1.032||1.001-1.035|N|||F|||20130805171655|CB
  OBX|4|NM|5803-2^pH Ur Strip^LN^30006200^PH^QDIWDL||7.8||5.0-8.0|N|||F|||20130805171655|CB

  <snip />

  OBR|9||CB018665A|ClinicalPDFReport1^Clinical PDF Report CB018665A-1^^ClinicalPDFReport1^Clinical PDF Report CB018665A-1|||20130404093200|||||||20130404083500||1122334455^ALLEN^JOSEPH^^^^^^^^^^NPI||||||20130805171655|||F
  OBX|1|ED|ClinicalPDFReport1^Clinical PDF Report CB018665A-1^^ClinicalPDFReport1^Clinical PDF Report CB018665A-1||QTE^Image^PDF^Base64^JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9GaWx0ZXIvRmxhdGVEZWNvZGUvTGVuZ3RoIDEwPj5zdHJlYW0KeJwr5AIAAO4Af plbmRzdHJlYW....
  <snip content="large chunks of base64 encoded PDF" />somethingsomethingsomething</string>
          <isMore xsi:type="xsd:boolean">false</isMore>
          <requestId xsi:type="xsd:string">551514a50a801e1512b2a98ed5f30b36</requestId>



Using the response document above, I need the request ID and the message control IDs. The request ID comes from the SOAP document. The message control IDs come from the HL7 MSH segment.

>> response_document.xpath('//requestId').text
=> "551514a50a801e1512b2a98ed5f30b36"

And here's what I send to Quest...

SOAP request:
SOAPAction: "acknowledgeResults"
Content-Type: text/xml;charset=UTF-8
Content-Length: 1029

  <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="" xmlns:xsi="" xmlns:wsdl="" xmlns:env="" xmlns:ins0="java:com.medplus.serviceHub.results.webservice" xmlns:ins1="java:com.medplus.serviceHub.results.webservice.printable" xmlns:ins2="java:javax.xml.rpc" xmlns:ins3="java:javax.xml.soap" xmlns:ins4="java:language_builtins.lang">
              MSH|^~&|PhysioAge Reporting|12345|LAB|QTE|201310091854||ACK|1372089260531|D|2.3.1
              MSH|^~&|PhysioAge Reporting|12345|LAB|QTE|201310091854||ACK|1372089260531|D|2.3.1

and I get back:

  <env:Envelope xmlns:soapenc="" xmlns:xsd="" xmlns:env="" xmlns:xsi=""><env:Header></env:Header> 
 <env:Body env:encodingStyle=""><m:acknowledgeResultsResponse xmlns:m=""></m:acknowledgeResultsResponse></env:Body></env:Envelope>


Just checking that you are human. What would be the result of this code?

a = 3*(4/2); b = 1; a+b

Goodboy said: We need someone with experience cafe aspirina forte The retired soccer star filmed some shirtless scenes for an upcoming H&M campaign on Tuesday, much to the delight of onlookers. Workers in London's Shoreditch district were treated to views of Beckham's chiseled and tattooed physique as he hung in the air while strapped in a harness and wearing tight blue briefs.

Caleb said: What sort of music do you like? erectzan side effects The telecom units came to Vimpelcom when it bought a 51percent stake in Egypt-based Orascom Telecom and all of Italy'sWind in 2011 for $6 billion. The sale plan does not includeVimpelcom's assets in Zimbabwe, which the company is negotiatingseparately, one of the sources said.

Danilo said: How much is a Second Class stamp? bisacodyl bp 5mg Others believed the situation with Pakistan is murkier since senior government and military officials have supported at least some of the strikes in the past, and U.S. officials say privately that some still do.

Clark said: Have you read any good books lately? avanafil goodrx This time, however, the state government said it was betterprepared. It broadcast cyclone warnings through loudspeakers andon radio and television as the first winds were felt on thecoast and in the state capital, Bhubaneswar.

Micheal said: Can you put it on the scales, please? viagra za ene This change seems a response to the reported cases of mistaken payments, where money has been taken from peoples' accounts without their knowledge but where they think they brushed against a reader by accident.

Clint said: Until August viagra tablet 50 mg price His forecasts, more optimistic than the other bidding operators’, still turned out to undershoot by hundreds of thousands, Masiyiwa said, adding that official data from organisations such as the World Bank also tend to underestimate Africa’s growth potential.

Jerald said: One moment, please viagra generico pagamento paypal Senator John McCain, whose fellow Republicans triggered the crisis with demands that the Democratic president's "Obamacare" healthcare reform law be defunded, said earlier on Wednesday the deal marked the "end of an agonizing odyssey" for Americans.

Valentin said: Languages viagra lowest prices The revelation led News Corp to withdraw cooperation withdetectives. Later, Murdoch belittled the police and said duringa meeting with staff from his Sun tabloid which was secretlyrecorded and broadcast in July that he had been wrong to helpthem.

Porfirio said: A First Class stamp pillenpharm viagra generika Sri Lanka's official censoring body had allowed the private screening of Flying Fish. But an official from the government-owned venue walked out of the showing and denounced the film, saying it portrayed soldiers as over-sexed and also degraded women.

Efrain said: I'd like to take the job topiramate er side effects New England's Tom Brady watched his long throw sail past rookie Aaron Dobson just as Tampa Bay defensive end Adrian Clayborn pushed 320-pound left tackle Nate Solder into him during a joint practice Wednesday in Foxborough, Mass.

Winford said: How many days will it take for the cheque to clear? clorfenamina paracetamol cafeina fenilefrina In a lawsuit filed July 25 in a San Francisco federal court, the former employees document Apple's screening process -- bag searches conducted whenever an employee leaves the premises, whether for lunch or clocking off for the day. Designed to discourage the theft of valuable Apple devices, the former sales representatives say that they were not paid for waiting time during screening -- which sometimes took 10 to 15 minutes -- and therefore should be entitled to compensation.

Geoffrey said: Can I call you back? ciprofloxacino solucion otica plm But I'm not sure it's Peter so much suddenly holding Carrie in greater esteem as that he now holds the CIA and his work in lower esteem, now that he has killed a child in the line of duty. Maybe the operation humanized him a bit, meaning that he does things like talk back to Saul and threaten bankers. Perhaps aside from this being the season of coping with terrible things, like you said, this is also the season of going rogue (Peter, Dana, Carrie).

Carlo said: I do some voluntary work minipress top blum However, the findings showed that vitamin B supplementation didn't have much impact on reducing the risk of heart attack. The study also showed taking folic acid, which is also known as vitamin B9, could reduce the benefits of taking of vitamin B supplements.

Stewart said: Have you got any ? levitra tablets uses While some question the need for an armed presence on campus, arming teachers and others when a school resource officer can't be hired is even more controversial. At least three states have passed laws allowing teachers to be carry handguns on campus.

Vincent said: The United States wauka mountain pharmacy Those bets looked prescient on July 24, when Facebookreported stronger-than-expected quarterly results and its sharesshot up 40 percent in the following week to top $38 for thefirst time since the IPO. The shares closed at$38.54 on Thursday.

Tristan said: How would you like the money? wellbutrin xr 300 opinie Among the Democratic mayoral candidates, former Congressman Anthony Weiner, who at some point led the race but saw his campaign crumble after news that his penchant for texting women lewd pictures of himself had not ended, placed last among the major candidates with 5 percent.

Jessie said: I'd like some euros quetiapine teva 25 mg virkning He talks about how much he loves baseball and respects it and how hard he is working to get back to the Yankees. But what does it all mean if he is guilty? It means he is no better than Lance Armstrong, who used to say all the same things about his love of cycling.

James said: For extremely delicate or fragile items, moving companies may use custom crating. Custom crating involves building a wooden crate around the item, which provides the highest level of protection during transport. Car Shipping in Fountain Hill, Arkansas