How to Get FHIR Photo for Patient from a URL - hl7-fhir

Consider the FHIR Patient data at http://spark.furore.com/fhir/Patient/f201.
How can I get the photo object referenced therein at URL "binary/#f006"??
I would have thought an HTTP GET on http://spark.furore.com/fhir/binary/#f006 would have done it, but alas...

the data there is wrong. Your conversion to the get was correct, but you ended up with a wrong URL because the reference is wrong in the first place.
It should say: url="Binary/f006" which would equate to a get of http://spark.furore.com/fhir/Binary/f006. That doesn't work either, which is another error in the way things are defined.
See http://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemEdit&tracker_item_id=6107 for follow ups

Yes, this reference is outdated, and we are not distributing Binaries currently as part of the examples in the FHIR specification. Our server Spark loads the examples from the specification when we initialize the database, hence the images are not there.
For now, I have uploaded the correct image to Binary/f006 and have updated the link in Patient/f201, so things should work now. When we re-initialize the database (we don't do this often), these changes will be reversed, but a simple PUT to Binary/f006 and an update of Patient/f201 will fix this of course.

Related

Google Drive API Folder/Child ID

Does anyone knows if the google folder id changes over time? Assuming, obviously, the folder is not deleted and recreated.
I'm trying to be limit the quota usage as much as possible, by storing the ID on our side.
Thanks
UPDATE (2015/09/01) Per 'BSEs' comment below.
Sorry, I assumed it is Android (being professionally distorted).
Anyway, to make sure, look at the ID string in question and compare it with the ID you get from drive.google.com > right click > Get link. You should see something like:
https://drive.google.com/open?id=0B1mqwertyasdfghZxCvbItM0E
If the id= string matches your resource ID, you're cool. Sorry for the confusion.
ORIGINAL (incorrect for .NET, applies to GooPlaySvcs/GDAA on Android)
I believe it does.
When testing the ResourceId availability here, I remember getting DriveId in one form immediately in the 'onResult()' callback. Later, when the 'onCompletion()' event occured, the DriveId of the same object looked very different (applies to both file and folder) .
Also, look at Daniel's comment here, it suggests that you should not rely on the value of the DriveId in any moment and use 'equals()'.
The ResourceId would be more appropriate ID to store, shuttle around, etc... DriveId is useless outside the GooPlaySvcs instance. And, based on some hints from Drive-Involved-Googlers, relying on a concrete value of DriveId is dangerous. That makes existence of 'encodeToString() / decodeFromString()' somewhat questionable, right?
Good Luck

Ruby viewpoint with EWS

I am trying to get started using viewpoint against EWS within Ruby, and it's not making a lot of sense at the moment. I am wondering where I can get some good example code, or some pointers? I am using 1.0.0-beta.
For example: I know the name of the calendar folder I want to use, so I could search for it, but how to access methods in that folder once I find it? What are the appropriate parameters, etc...
Any advice?
If you haven't read it yet I would recommend the README file in the repository. It has a couple of examples that should put you on the right path. Also, the generated API documentation should give you enough to work with.
http://rubydoc.info/github/WinRb/Viewpoint/frames
At a very basic level you can get all of your calendar events with the following code:
calendar = client.get_folder :calendar
events = calendar.items
I hope that gives you a little more to get started with.
Follow-up:
Again, I would point you to the API docs for concrete methods like #items. There are however dynamically added methods depending on the type that you can fetch with obj.ews_methods. In the case of CalendarItem one of those methods is #name so you can call obj.name to get the folder name. The dynamic methods are all backed by a formatted Hash based on the returned SOAP packet. You can see it in its raw format by issuing obj.ews_item
Cheers,
Dan

How to serve static profile images in node

This is really more of a "using what method" than a "how-to" question. I am creating a site in NodeJS with Express. So, each user has the ability to upload a profile picture, and my concern is how to route requests for these images. A couple of questions I have are:
Can I use express.static() to serve a default file if a valid one isn't specified? If not, am I going to have to specify a GET route for /img/profileand handle the FS querying there?
How can I find the correct image if multiple file extensions are allowed? (I originally just removed the file extension and they appeared in img tags anyway, is that okay?)
I am currently naming all pictures after their user's name. Looking ahead into the future (for apps I may have to scale), what are normal naming conventions for static user content? Are most stored with a UUID referencing the content in the database?
What else should I take into consideration that I may not have accounted for yet?
First question:
At present, I'd recommend storing your images in a predictable location that can be inferred from some combination of columns or fields in your database entries. One of those fields or columns would be a filename (accounts for different extensions). Then, if they haven't uploaded an image, you just lay down in your view code a reference to the generic "has not set an image" file.
express.static obviously can server static files, but it currently doesn't have a way to serve some other file if the one you wanted isn't there. Because this sounded like fun, I made some modifications to static to support what you request and submitted a couple of pull requests (the feature touched 2 different modules):
In send: https://github.com/visionmedia/send/pull/33
In connect: https://github.com/senchalabs/connect/pull/999
I don't know if those will get included in the project, but if you want to see my forks that have these changes, they are here:
https://github.com/bigohstudios/send
https://github.com/bigohstudios/connect
If this went through, you would mount a static at the root of your profile image files:
app.use(static('<profile image files root>', { fallback: 'anon.jpg'}))
Second question
I generally store the extension in my DB, then when I load the image, I have the correct extension to put into the src attribute on the img tag.
Third question
If you can guarantee unique names, then using those would work. I prefer using the DB id or a UUID as you suggest. It's less intuitive when scanning all the image uploads, but I rarely find myself doing that. I'm usually hunting for a specific image, and I can look up the identifier for that as needed.
Fourth question
You may end up storing the static content outside your app server (e.g. on S3). If that happens, then of course static won't help you.

Google Analytics not tracking conversions in Magento 1.7

I'm using Magento's built in Googleanalytics module which is working fine for page views, but not for conversions. The account is set up fine on Google, but it's not adding the addTrans part in the checkout/onepage/success page.
I've done a lot of digging this morning, and found that the observer does observe the "checkout_onepage_controller_success_action" correctly, and does indeed run. It does the following:
$block = Mage::app()->getFrontController()->getAction()->getLayout()->getBlock('google_analytics');
if ($block) {
$block->setOrderIds($orderIds);
}
I've done some echoing, and it does retrieve the block, and it also sets the order ids correctly. However, in the block itself, if I echo out $this->getOrderIds(); its empty.
My next thought was that perhaps it could be using two GA blocks on the page, and maybe its passing the data to the first one but echoing the HTML of the 2nd one, but I've no clue how to start checking that! The Googleanalytics.xml file only has one block it in, and I don't use that block name anywhere else!
Anyone experienced similar? Or have any idea where I can go from here?
EDIT:
The Ga.php block includes the transaction code if $this->getOrderIds() returns an array, which it is not doing. However, the observer is doing $block->setOrderIds($order_ids); which is passing through an array containing an order id. So the observer is passing the ids to the block, and the block is receiving them (setting up a method of setBlockIds and echoing out the argument, does show the array), but when the block tries to access its own data, it's suddenly not there ($block->getData() returns an array of properties but there is no order_ids property).
I also figured maybe it could be that its echoing the blocks HTML before setting the order id, so I added some variables in to check that and it's not that - its definitely setting the order_ids before trying to get them again, but its still not working!
I'm completely stumped! My only idea now is to modify the Ga.php block to use Magento's registry instead of it's own _data property, which is really not a nice way of doing it!
I think i've been an utter tool. Magento wasn't tracking conversions on the live site because I hadn't put the account code in the configuration part, but I had on my test site.
I had previously put my own analytics code in the template, so I had tracked page views.
When I saw no conversions (despite putting the account code in my test site), I started making orders on the test site and then viewing the source of the order success page. Firefox loads its source as a new request...which automatically goes to the empty basket page. So obviously, it wasn't showing the addTrans or anything, because it had already done that.
A quick check in firebug revealled it was working as it should.
So in the end, after a day of searching, I had to change "No" to "Yes" in the admin, and type in the account code. Great.

Implementing resource list in WP7

I am porting a JAVA game to WP7. We have lots of images in our game and for loading them in JAVA use a function something like this "Resources.getImage(IMG_BULLETS);" where IMG_BULLETS is ID(an int) of the image.
But in WP7 we have to pass the path(a string) of image in order to load that.
Now my question is :
How to achieve a int-String mapping? so that I dont have to manually change the Id into path.
One possible solution comes in my mind is to have a .txt file having image path and its Id and parse that. But I am sure their is much better solution for this.
Note : we also have a multi-level folder structure for images and other files.
If you really want to refer to resources by int, you are going to have to map them some how to their path. As far as I know, there is no way to crawl your assets, and even if you could, i some how doubt you will get the same index order and you would have to redo your enum.
There are going to be a few hurdles you hit with trying to port and code changes. Another one, (one you will still have even with a txt file work around) will be that the contentManager.Load takes a type, eg, contentManager.Load<Texture2D>('path') returning a Texture2D.
One option would be to create your own singleton 'Resources' class that has get methods that take int to get the appropriate asset, however you will still need a mapping via xml or txt file of somekind. However this will require all your assets being loaded from the start which are more problems of their own (90mb memory limit and really long load time).
My advice would be look at the game development section of the App Hub and have a look at the game state example to help you see how you might be able to structure your game to work well with XNA.

Resources