smart-on-fhir / api-server Goto Github PK
View Code? Open in Web Editor NEWOpen-source FHIR Server to support patient- and clinician-facing apps
Home Page: http://smartplatforms.org
License: Other
Open-source FHIR Server to support patient- and clinician-facing apps
Home Page: http://smartplatforms.org
License: Other
Get the rdflib versions right or eliminate dependency
I'm getting the following response with this call (but would expect an OperationOutcome
in JSON):
curl -H "Accept: application/json+fhir" https://fhir-open-api-dstu2.smarthealthit.org/Patient/xxx
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /WEB-INF/grails-app/views/api/read.jsp. Reason:
<pre> Not Found</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>
</body>
</html>
Currently the property is omitted
For instance allow:
GET /MedicationPrescription?patient.name=john
instead of insisting on
GET /MedicationPrescription?patient:Patient.name=john
But continue to insist on disambiguation when there's >1 possible type, as in:
GET /Observation?subject.name=john
(In this case, provide a friendly error message.)
Right now the Quantity
handler is a copy/paste of Numeric
, but it needs to support matching on units as well as greater than + less than searches...
Hello,
Our organization just went from DSTU2 to DSTU3. In the DSTU2 version the encounter object has a method "class_" that accepts an enumeration of consisting of states of the patient such as "Inpatient", "Outpatient","Ambulatory", etc... The DSTU3 version has modified the class_ method to take a Coding object that consists of a CodeID(string) and DisplayText (string). So the question is, with the enumeration gone, how are the states to be persisted in this Coding object? We certainly cannot rely on a string for determining state as there may be a plethora of fat fingered patient states hydrating the object.
Storing Documents + DocumentReferences
BASE_URL="http://localhost:8080"
CLIENT_ID=client
CLIENT_SECRET=secret
PATIENT_ID="1234"
CCDA="grails-app/conf/examples/ccda.xml"
./grailsw run-script scripts/LoadCCDA.groovy
ERROR: -bash: run-script: command not found
ERROR: file does not exist grails-app/conf/examples/ccda.xml
Josh,
I got the server running. However, when I try to POST Patient-example.xml with command:
curl 'h0/DiagnosticOrder/example' -X PUT -H 'Authorization: Basic Y2xpZW50OnNlY3JldA=='-H 'Content-Type: text/xml' --data @grails-app/conf/examples/Patient-example.xml
I get this message:
Warning: Couldn't read data from file
Warning: "grails-app/conf/examples/Patient-example.xml", this makes an empty
Warning: POST.
On the server side, I see this:
Evaluating request org.apache.catalina.core.ApplicationHttpRequest@f62d719 with null
Formats: xml + xml
errors.GrailsExceptionResolver IOException occurred when processing request: [PUT] /DiagnosticOrder/example
Stream closed. Stacktrace follows:
java.io.IOException: Stream closed
at fhir.ApiController.parseResourceFromRequest(ApiController.groovy:131)
at fhir.ApiController.update(ApiController.groovy:149)
at com.brandseye.cors.CorsFilter.doFilter(CorsFilter.java:82)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
fhir.ErrorController Rendering a 500 error
fhir.ResponseFilters rendered after: 14
Any pointers? Thank you for the help!
Consider support for ordered results. May need to derive the order client-side, or split resourceIndex
into resource-specific collections (because MongoDB has a limit of 64 indexes per collection, and while k:v
works for search queries via $elemMatch
, it doesn't work for sort.)
•Turn authentication or off with fhir.oauth.enabled : true | false
Where do we pass this flag or add this flag? I tried to pass it on the command line as:
./grailsw run-app --fhir-oauth.enabled:false
That did not work and got an error about oauth not being setup.
Thanks!
Allow the server to determine URL via context. This allows "clean" API service urls like https://api.fhir.me
Should merge authorization data from the auth server's token introspection endpoint with (nominal) data about users and their actual permissions. This would encapsulate:
I noticed our API server doesn't honor Accept: application/json+fhir
and just returns an XML formatted OperationOutcome
.
To replicate using HTTPie:
http https://fhir-api-dstu2.smarthealthit.org/Patient family==Argonaut given==Jason Authorization:"Bearer xOoZyp" Accept:application/json+fhir
Rewrite the main UI to launch with administration level privileges and support listing patients, arching, launching an app on a record...
Port growth chart, Cardiac Risk, BP Centiles, and time permitting, med rec depending on how lists can be handled.
will need a clear way to determine which resources belong in a given compartment! Maybe something simple like "Everything that links to a patient"?
Will this server support DSTU3 resources(FHIR Patient, Contract) ? if not do you recommend one that does it please?
rather than hard-coding the UI into the server. Ideally this would handle
consuming a conformance profile or defaulting to a full feature set
list available resources + calls
support auto-population of search params
errors
content-types
Should be totally client-side using CORS requests -- but should also have a built-in server side pure proxy to support interaction with non-CORS FHIR servers.
Currently relying on .jars from the FHIR source packages. Don't want to host these as binary libs...
I am trying to update the record in the FHIR server it is throwing me following exception with 500 status. I am not sure some this is missing.
Below is the Exception I am getting
" Exception in thread "main" java.io.IOException: Server returned HTTP response code: 500 for URL: http://fhir.dev.aimsplatform.com/Patient/1272431_format=xml
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at com.test.HttpURLConnectionExample.updatePatientRecord(HttpURLConnectionExample.java:157)
at com.test.HttpURLConnectionExample.main(HttpURLConnectionExample.java:30)"
Following is the code snippet I am using. Please help me on this
//update particular patient record
private void updatePatientRecord(int PatientID) throws Exception {
String url = "http://fhir.dev.aimsplatform.com/Patient/" + PatientID +"_format=xml";
//PUT https://example.com/path/{resourceType}/{id}
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
String authStr = "client"+":"+"secret";
System.out.println("Original String is " + authStr);
// encode data on your side using BASE64
byte[] bytesEncoded = Base64.getEncoder().encode(authStr .getBytes());
String authEncoded = new String(bytesEncoded);
con.setRequestProperty("Authorization", "Basic "+authEncoded);
// optional default is PUT
con.setRequestMethod("PUT");
con.setDoOutput(true);
con.setDoInput(true);
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
JSONObject details = new JSONObject();
details.put("city","california");
details.put("country","usa");
OutputStreamWriter wr= new OutputStreamWriter(con.getOutputStream());
wr.write(details.toString());;
wr.flush();
InputStream ins = con.getInputStream();
InputStreamReader isr = new InputStreamReader(ins);
BufferedReader in = new BufferedReader(isr);
//output the information
String inputLine;
while ((inputLine = in.readLine()) != null)
{
System.out.println(inputLine);
}
in.close();
}
ᐧ
Avoid removing/adding table on update. Just hide/cover to prevent up/downs in small viewports.
Rely on an external OAuth2 authorization server to issue tokens, and check with that server (via introspection endpoints) when protected resource requests arrive.
Add a set of SMART export scripts for FHIR... at least for
... and when done, update conformance profile to indicate support.
when I follow the instructions and successfully run the project.and I can access http://localhost:8080/
but when i try the following code,I get a error 10061 access denied
curl 'http://localhost:8080/DiagnosticOrder/example'
-X PUT
-H 'Content-Type: text/xml'
--data @grails-app/conf/examples/diagnosticorder.xml
At present, smart-on-fhir uses the XPath found in the Conformance
resource to build search indexes to enable searching the documents it stores. Unfortunately, the latest version of FHIR (me.fhir:fhir-0.12:0.2
) removes this XPath, meaning that grails-app/conf/profile.xml
can't be parsed when using the latest version of FHIR. As the information stored in that resource is used by the SearchIndexService
to determine how to provide search information, this effectively breaks smart-on-fhir.
I'm not entirely clear on whether this information is entirely removed from the FHIR spec or just moved to a different location, but it does present an issue moving forward.
https://github.com/smart-on-fhir/api-server
URL "Sample Patients:" point to https://github.com/chb/smart_sample_patients/tree/fhir
Getting more sample data
You can load sample data from SMART's Sample Patients:
$ sudo apt-get install python-jinja2
$ git clone --recursive https://github.com/smart-on-fhir/sample-patients
$ cd sample-patients/bin
$ git checkout fhir
$ python generate.py --write-fhir ../generated-data
$ ls ../generated-data # a bunch of XML files
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.