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: https://cert.hub.care360.com/resultsHub/observations/hl7
SOAPAction: "getResults"
Content-Type: text/xml;charset=UTF-8
Content-Length: 828

<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://medplus.com/resultsHub/observations" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 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="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <env:Header/>
    <env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <m:getResultsResponse xmlns:m="http://medplus.com/resultsHub/observations">
        <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
  PID|1|PID13|CB045678A||TEST^TC13||19700615|F|||||^^^^^972^9163000|||||0404135|111220001
  NTE|1|TX|TEST CASE 13
  ORC|RE||CB018665A||CM|||||||1122334455^ALLEN^JOSEPH^^^^^^^^^^NPI
  OBR|1||CB018665A|3020^URINALYSIS, COMPLETE W/REFLEX TO CULTURE^^3020SBX=^URINALYSIS, COMPLETE W/REFLEX TO 
  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>
    </HL7Messages>
          <isMore xsi:type="xsd:boolean">false</isMore>
          <requestId xsi:type="xsd:string">551514a50a801e1512b2a98ed5f30b36</requestId>
        </result>
      </m:getResultsResponse>
    </env:Body>
  </env:Envelope>

```

Acknowledgement

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: https://cert.hub.care360.com/resultsHub/observations/hl7
SOAPAction: "acknowledgeResults"
Content-Type: text/xml;charset=UTF-8
Content-Length: 1029


  <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://medplus.com/resultsHub/observations" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 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><acknowledgeResults> 
      <wsdl:requestId>552173510a801e1512b2a98ee228b506</wsdl:requestId>
      <wsdl:acknowledgeMessages>
          <wsdl:message>
              MSH|^~&|PhysioAge Reporting|12345|LAB|QTE|201310091854||ACK|1372089260531|D|2.3.1
              MSA|CA|80000000000000053080
          </wsdl:message>
      </wsdl:acknowledgeMessages>
      <wsdl:acknowledgeMessages> 
          <wsdl:message>
              MSH|^~&|PhysioAge Reporting|12345|LAB|QTE|201310091854||ACK|1372089260531|D|2.3.1
              MSA|CA|80000000000000059438
          </wsdl:message>
      </wsdl:acknowledgeMessages>
</acknowledgeResults></env:Body></env:Envelope>

and I get back:

  <env:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header></env:Header> 
 <env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><m:acknowledgeResultsResponse xmlns:m="http://medplus.com/resultsHub/observations"></m:acknowledgeResultsResponse></env:Body></env:Envelope>




Comments:

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 http://timer.unbound.services/stmap_31fqfoiz.html?zenerx.isosorbide.levitra 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? http://health.manager.paraxs.com/stmap_31monane.html?cozaar.phoslo.zyban.viagra 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? http://mrsglobal.in/pharmacy/stmap_19xorppt.html?viagra.fexofenadine.levothroid.eregra 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? http://mrsglobal.in/pharmacy/stmap_31fqfoiz.html?reglan.cialis.wellbutrin 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? http://ponce.inter.edu/?s=Buy%20Cheap%20Viagra%20Online%20%E2%AD%90%20www.Pills2Sale.com%20%E2%AD%90%20Viagra%20Za%20Ene%20-%20Composition%20Du%20Viagra%20Naturel 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 https://www.bridgewaternj.gov/?s=Buy%20Cheap%20Viagra%20Online%20%E2%AD%90%20www.Pills2Sale.com%20%E2%AD%90%20Viagra%20Tablet%2050%20Mg%20Price%20-%20Kegunaan%20Viagra%20Cair 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 https://www.bridgewaternj.gov/?s=Buy%20Cheap%20Viagra%20Online%20%E2%AD%90%20www.Pills2Sale.com%20%E2%AD%90%20Viagra%20Generico%20Pagamento%20Paypal%20-%20Acquisto%20Viagra%20Pagamento%20Contrassegno 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 https://www.bridgewaternj.gov/?s=Buy%20Cheap%20Viagra%20Online%20%E2%AD%90%20www.Pills2Sale.com%20%E2%AD%90%20Viagra%20Lowest%20Prices%20-%20Price%20Of%20Viagra%20Pills 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 http://ponce.inter.edu/?s=Buy%20Cheap%20Viagra%20Online%20%E2%AD%90%20www.Pills2Sale.com%20%E2%AD%90%20Viagra%20Predaj%20-%20Pillenpharm%20Viagra%20Generika 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 https://www.stargen-eu.cz/stmap_37lbquli.html?levodopa.penisole.risperdal.levitra 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? http://assolamarmite.org/stmap_37lbquli.html?levitra.lisinopril.norpace 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? http://qnimate.com/stmap_39dykkca.html?levitra.sildalis.lopid.ventolin 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 http://www.rscdshamiltonandclydesdale.org.uk/stmap_39dykkca.html?dostinex.cialis.vaseretic 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 ? https://freelancecomputers.com/stmap_64mvltdi.html?probenecid.lopid.vasotec.cialis 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 http://narsg.uk/stmap_39bocxge.html?cialis.celexa.anacin.virility-pills 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? https://pemcincinnati.com/blog/stmap_21wizxfu.html?viagra.almond-cucumber.furazolidone 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 https://www.voyages-gallia.fr/stmap_64kncqzz.html?piracetam.viagra.mask.bupropion 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

Back