Skip to content

Instantly share code, notes, and snippets.

@healthhiway
healthhiway / phr_queries_hireps
Created December 27, 2010 10:07
PHR models and queries for HiReps
Patient
-------
string uhid
string first_name
string middle_name
string last_name
datetime registration_date
string sex
datetime dob
{"patient" : {
"address" : "KARUPPUR,KARUPPUR(PO),MAYANUR(VIA).",
"city" : "KARUR",
"created_at" : "2010-12-01T14:27:04+05:30",
"dob" : "1954-12-19T00:00:00+05:30",
"doctor_id" : null,
"email" : null,
"first_name" : "SIRUMBAYEE",
"id" : 0,
"last_name" : "R",
{"patient":{"address":"KARUPPUR,KARUPPUR(PO),MAYANUR(VIA).","city":"KARUR","created_at":"2010-12-01T14:27:04+05:30","dob":"1954-12-19T00:00:00+05:30","doctor_id":null,"email":null,"first_name":"SIRUMBAYEE","id":0,"last_name":"R","middle_name":null,"mobile":null,"phone":"9751205981","phr_id":null,"pin":null,"registration_date":"2009-12-19T00:00:00+05:30","sex":"F","state":"TAMIL NADU","uhid":4784,"updated_at":"2010-12-01T14:27:04+05:30"}}
@healthhiway
healthhiway / Queries
Created October 4, 2010 05:41
Models and Queries required for Akhil HIS integration
1) For a given UHID, I want the details in the Patient model as above
2) For a given UHID, I want a list of Textual and Numeric Results (Profiles and Special are also a part of the texual result)
3) For a given UHID, I want a list of Textual and Numeric Results, since a given Result Date
4) For a given UHID, get a list of encounters
5) For a given UHID, get a list of encounters since a given date
6) For a given encounter id, get a list of procedures
7) For a given encounter id, get the discharge summary
8) For a given Doctor ID, get me a the details in the doctor model.
vagmi@deepthought-2 ~ $ ab -n 1000 -c 40 http://test.hiwayhealthconnect.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking test.hiwayhealthconnect.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
#delete the users
User.all.each { |u|
u.access_context = {:user=>u.id.to_s}
u.destroy
}
#create the users
User.create(:login => 'root1',
:password => 'root',
:role => 'root',