Skip to content

Instantly share code, notes, and snippets.

@ananthakumaran
Created December 8, 2010 13:30
Show Gist options
  • Save ananthakumaran/733281 to your computer and use it in GitHub Desktop.
Save ananthakumaran/733281 to your computer and use it in GitHub Desktop.
ruby-1.9.2-p0 > payload = <<EOF
ruby-1.9.2-p0"> {"procedure" :
ruby-1.9.2-p0"> {"code" : 454,
ruby-1.9.2-p0"> "created_at" : "2010-12-07T15:35:46+05:30",
ruby-1.9.2-p0"> "doctor_id" : 835,
ruby-1.9.2-p0"> "encounter_id" : "4783",
ruby-1.9.2-p0"> "id" : 5,
ruby-1.9.2-p0"> "name" : "SUTURING MINOR",
ruby-1.9.2-p0"> "opdipd" : "O",
ruby-1.9.2-p0"> "procedure_date" : "2009-12-19T14:09:00+05:30",
ruby-1.9.2-p0"> "referred_by" : 835,
ruby-1.9.2-p0"> "uhid" : 4444,
ruby-1.9.2-p0"> "updated_at" : "2010-12-07T15:35:46+05:30"}}
ruby-1.9.2-p0"> EOF
=> "{\"procedure\" :\n {\"code\" : 454,\n \"created_at\" : \"2010-12-07T15:35:46+05:30\",\n \"doctor_id\" : 835,\n \"encounter_id\" : \"4783\",\n \"id\" : 5,\n \"name\" : \"SUTURING MINOR\",\n \"opdipd\" : \"O\",\n \"procedure_date\" : \"2009-12-19T14:09:00+05:30\",\n \"referred_by\" : 835,\n \"uhid\" : 4444,\n \"updated_at\" : \"2010-12-07T15:35:46+05:30\"}}\n"
ruby-1.9.2-p0 > HTTParty.post('http://dev.hiwayhealthconnect.com/api/site/import/procedure/', :query => { :data => payload, :site_id => 'test', :site_api_key => 'test' })
=> #<HTTParty::Response:0x9a905d4 @parsed_response="{ success : true, msg : 'procedure successfully imported' }", @response=#<Net::HTTPOK 200 OK readbody=true>, @headers={"server"=>["nginx/0.7.65"], "date"=>["Wed, 08 Dec 2010 13:27:35 GMT"], "content-type"=>["text/html;charset=utf-8"], "connection"=>["close"], "content-length"=>["59"], "set-cookie"=>["rack%3Asession=b0dfdc515cfb6ee1c09c80d8d4d41919; path=/; HttpOnly"]}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment