Persoonlijk GezondheidsDossier? Klinkt mooier dan het is!

Zie mijn blog op Trendition: Persoonlijk GezondheidsDossier? Klinkt mooier dan het is!

Posted in Uncategorized | Leave a comment

Zijn standaarden in de zorg wel zo’n goed idee?

Zie mijn blog op Trendition: Zijn standaarden in de zorg wel zo’n goed idee?

Posted in Uncategorized | Leave a comment

Trendition: Inzage patiëntendossier roept interessante vragen op

Een blog van mij op Trendition:

Alleen inzage in het dossier geeft nog geen inzicht! Hoe lossen we dit op?

Posted in Uncategorized | Comments Off on Trendition: Inzage patiëntendossier roept interessante vragen op

3D Printing Myself – or: Do we have a Free Will?

I intend to read two books on free will soon, Samuel Harris’ ‘Free Will’ (which argues that free will is an illusion) and Julian Baggini’s ‘Freedom Regained’ (which argues free will is possible). Before reading those two (on which I will get back here), I wanted to pen down my own ideas on free will, to see whether reading the books will make me change my own views. The problem of free will has bothered me since I studied philosophy (or possibly before), since it seems to lead to either inconsistencies or world views which I find very implausible.

Free will – the idea that we choose our actions voluntarily, based on our own judgment, and that we could have chosen otherwise if we wanted – presupposes the idea of choice: that what we have done in the past could have been otherwise, and our future is not given by the circumstances, but a least partially decided by our own choices. So the question: do we have a free will is dependent on another question: do we have a choice at all. A thought experiment will help to highlight the essence of the problem.

Imagine a perfect 3D printer, capable of copying dead matter as well as living beings. If I were to copy myself, Marc-the-copy would be a perfect copy of Marc-the-original. Marc-the-copy would contain the same molecules, in the same places, the same strands of DNA, the same RNA, the same blood cells, intestinal lining and brain. The same neurons, intertwined in the same way, with the same amounts of neurotransmitter in the same spots, connected with the same axons to the same nerves. If there is still an idea of an ‘original’ and a ‘copy’, where the copy would not be ‘the same’, since there is only one original, we could assume that the original’s molecules would be split evenly amongst both copies, and that the 3D printer would supply each of both copies with the missing molecules, according to the blueprint – the now-gone original.

Next, assume that the 3D printer would print both Marc-copies to identical rooms, again perfect copies of each other. The same table with some coffee and some sandwiches, the same vase of identical roses underneath the same copy of a Vermeer’s Milkmaid. The same bright lightning, the same anonymous waiting room music on the same radio.

Now, what would both copies do? Would they do the same thing or not? Would both pick the ham sandwich, or might one go for ham and the other for tuna? Is it possible that one would skip the sandwiches and go straight for coffee, while the other would have a sandwich first and a coffee later? Could one tune the radio to Adele’s ‘Someone like you’, while the other copy would prefer Chopin’s Nocturnes? And, if you go for the same choice, would both copies do the same thing always? Again and again and again, as long as the environment is exactly the same? So basically: given the exact same material make-up of both individual and environment, would it be possible to have different outcomes when the individual is faced with a choice, or is the outcome of the choice always determined? This is not about determinism ‘light’, where we are bound by our genes and circumstances to be obese, or smart et cetera. That would still allow both copies to sometimes make different choices. This thought experiment is about a very strong determinism: is different action possible at all for both copies?

Let’s go down the possible scenarios, and see the repercussions of each scenario on the possibility of free will.

They would do the same.

That is, always the same. The world we’ve chosen is completely deterministic, at least where human choices are involved. All choices are contained in the material circumstances, and given those, the outcomes are fixed.

This view has some paradoxical consequences. The things we do often seem to make sense. If I want to drive to Paris, and I don’t know the way by heart, I will follow the road signs (or my navigation system nowadays). So if I’m near Brussels, and I see a sign ‘Paris’ with an arrow to an exit on my right hand, I will most likely take that exit. Now, in a deterministic universe, the road signs wouldn’t matter. I would take the right exit anyway, regardless of what the signs say, since my driving choices are predetermined. So whether the sign would point to the left exit for Paris or the right wouldn’t matter. Nothing said or written would matter at all, it seems. I do like to read a novel in the evening, and if the story is good, it gives me a sense of satisfaction. Now, in a deterministic universe, I could read a random collection of letters, a totally nonsensical whole of arbitrary non-words, and still have the same sense of satisfaction if the material circumstances dictated such.
Of course the two universes – one with the sign Paris to the right, and the other to the left, aren’t exactly the same, since at least the paint on both signs is applied differently. The point is this difference cannot explain my taking the right exit. The connection ‘sign to the right’ – ‘taking the right exit’ does only make sense if we suppose that I see the sign, read it, and make a decision based on that information – a decision which could have been otherwise. But exactly this free decision is impossible in a deterministic universe, since there is no choice. So we cannot say things sense because signs to the right trigger human decisions to go to the right, since humans cannot make such decisions.

So why does it all make sense? What are the possible answers to that in a deterministic universe?

It doesn’t make sense

This idea of sense is all an illusion. The road signs don’t influence where I go, nor does the novel I read induce my sense of happiness. That is all an illusion. In fact, many road signs do point to the left while I go right, and what I read is garbage (not in the sense of literary criticism, but in the sense that I do really read random collections of meaningless signs). In a deterministic universe we don’t need consistency between signs and actions, and there is in fact none.

This world view is maybe consistent in itself, but not very consistent with experience. We do feel we take the right exit because of the sign, and we enjoy the novel because of the content. So this view has some explaining left to do, and is very counterintuitive. And it needs explaining why we have the illusion of consistency.

It cannot not make sense

For some reason, a deterministic universe where road signs to Paris would point to the left, while people heading to Paris go right is not possible.
Of course such an observation is very intuitive. It seems most logical that if road signs point to the right, we would go right. But this only an explanation when we do have some degree of choice. It presumes we go right because we see the road sign, and decide to go right. Without that decision, what could possible cause the coherence between road signs and directions taken? If we do not have choices, the road sign to the right could not be the cause of our choice of taking the right exit.
So our choosing so cannot be the explanation of correspondence between signs and actions in a deterministic universe. Let’s see what could be, and what determines the outcomes of our actions.

Matter decides the outcomes

Matter (on a macroscopic level anyway) decides what happen, or at least our actions. Given a powerful enough computer, all our action could be calculated in advance. (Of course we needn’t assume a Newtonian universe. Matter may behave according to the quantum-mechanical uncertainty principle, but this doesn’t influence human behavior. It was only the choice of the two copies which was deterministic in our thought experiment, not necessarily the entire universe.)

But if it is matter that decides the deterministic outcomes of our choices, it is nearly impossible to see why things make sense. We must assume some law of nature which excludes nonsensical combinations, i.e. road signs to Paris to the left and cars heading for Paris going to the right. And this must be the weirdest kind of law possible, different from all laws of nature that we know.

Something else decides the outcomes

You may believe that it is not matter which decides the outcomes, but something else. An omnipotent god, or a universal non-material principle. This is more consistent. It all makes sense because god, (or the universal principle) has decided that things should make sense.

So in this universe we have no free will. Thus universe does make sense. Something (god, a non-material principle) makes it make sense. And this something also decides everything we do, the outcome of all our apparent choices. This universe is still somewhat counterintuitive since we do feel we make the choice to take the right exit ourselves, but this idea of freedom of choice may be an illusion. There are more known illusions of a similar nature. Assuming a god or principle doesn’t explain much: the question goes from ‘why does it all make sense’ to ‘why does a god make it make sense’ – but the world view is consistent in itself.

They would not do the same.

Now if we assume both copies of Marc would not (always) do the same thing, what could cause the difference in behavior?

Something material

We’ve already assumed the copies are the same, as are the rooms they’re in. So where could a material cause for different choices come from?

Something outside the individual

Maybe one could say that both copies are influenced by the universe at large, and they can’t both occupy the same space in that universe. This is a bit tweaking with the assumptions of the argument, which stated that both copies would have the same environment. And of course one can say that that simply is not possible. Still, if something material outside the copies would decide the difference in outcome, then this would be a deterministic universe. Each of the copies could not make another choice, since the outcomes are determined by something material outside. So saying ‘something outside’ makes the choices differ, still doesn’t really allow choice. We’re back at the deterministic world view, only the room has become larger.

Chance events

Maybe our brains are wired in such a way that they contain ‘quantum-mechanical coins’. In each of the two copies, the coins are flipped and one may land heads up, while the other goes for tails. The differences are pure chance. No influence of the individual.

This is a nondeterministic universe, albeit with only random ‘freedom’. There is no pre-determination, but also no real choice – just chance events. Things could have been otherwise, but only through random events. And randomness still doesn’t explain choice. If we flip a coin which decides whether we go right (heads up) or left (tails) and the coin lands heads up, we can say we’ve chosen to flip a coin, but we would never say we’ve chosen to go right. So the quantum-mechanical coin in our heads could explain variation in behavior, but we couldn’t really call it choice. It might explain why things appear to make sense – it the road signs say ‘Turn right for Paris’, our mental make-up might be so that the coin is much, much more likely to flip so that we do turn right.

Non-chance events

This seems hard to imagine. Both copies are the same, materially spoken. They don’t make the same choices. This difference is caused by something material. And this material cause is not a chance event, no throw of the dice.
It’s hard to imagine how pure matter (since in this universe, nothing but matter decides the difference in choice between Marc A. and Marc B.) could lead to any but random differences. Apparently in this universe, matter has some properties which are nondeterministic, but not chance either. It seems this universe assumes some hitherto undetected properties of matter. This is of course not impossible, but not very plausible too. We simply would assume some ‘choice’ of ‘free will’ property of matter itself, to explain our free will.

Something immaterial

Another assumption, if both copies of Marc do not make the same choice, is that the difference in behavior is caused by something nonmaterial.

Something immaterial in the individual

We can assume we have a (nonmaterial) mind, or a soul, or immaterial ‘spirit’. This spirit can make choices, and this causes the different outcomes for both copies of Marc. But how does this spirit influence the matter? This is basically Descartes’ problem. There is nothing in the material theories we have which allows such an interaction between an immaterial spirit and our material body. Somewhere there would need to be a connection, where the immaterial can trigger the material. This is not logically impossible, but still, given what we know, it’s hard to fathom where and how this would happen.

Something immaterial outside the individual.

If a god, or something else immaterial decides the different outcomes, the individual is apparently not free to choose. So, like the case where ‘outside matter’ decides the different outcomes, in this case there is no real choice either, since it is coming from outside. Once the ‘outside’ has made up its mind, there is no possibility for the individual to choose anything other than that what already had been decided outside. Taking a god as the cause of different actions of the two Marc copies does raise the same question as the spirit: where does this god interact with matter? (Note that a deterministic universe does not have this problem: a god could have created this universe from the start so that all outcomes are decided in advance, and wouldn’t need to interact with it after creation.)

Other solutions

We’re not smart enough

Maybe language, and human thought, is not capable of understanding the very concepts we are researching. Maybe ‘free will’ is simply not a consistent concept, and we cannot reason with it in the same way as we can with concepts such as cars, forces of nature, road signs or sandwiches.

An open question is why there is a universe at all – why isn’t there just nothing? I haven’t read any satisfactory answers to this question. The answers fall in two categories. The first assumes something else, god or a law of nature, which needs explaining as well – why is there a god instead of nothing, why is there a law of nature at all? The second does not assume something else, but doesn’t really move beyond the big bang. I believe it is possible that the concept of ‘nothing’ may just not make sense enough to reason with it. We never perceive ‘nothing’, only the absence of other stuff – no light, no people, no planets. But it is not a given that a combination of absences leads to a ‘nothing’ with which we can reason as if it were something. So maybe ‘nothing’ just isn’t a coherent enough concept, and the question ‘why isn’t here nothing’ just doesn’t make sense like ‘why isn’t there coffee’ because ‘nothing’ is not as coherent a concept as ‘coffee’.

In the same way, ‘free will’ may be a concept that’s not coherent enough to allow the kind of reasoning I’ve done with it in this paper. So instead of getting an answer, we must conclude that the question was wrong all the time. I do like this answer, but I have no proof of it either. There is no ‘grand theory’ explaining which concepts can be reasoned with, and which ones cannot. So saying ‘free will’ is an inconsistent concept does amount to assuming something to make the problem go away.

Yet other solutions

There might simply be more than we know. I’ve contrasted ‘material’ versus ‘immaterial’ stuff and more, but there may be more than we know of. I’ve touched upon the possibility of properties of matter yet unknown, and there may simply be stuff (material or not) constituting the universe that we do not know of yet. So maybe there is a free will, in a sensible way, be we still need to discover how or what makes it possible.

(Not a) conclusion

So far, for me, there is no satisfactory conclusion in the free will debate. A deterministic universe, were a god (or universal principle) has planned everything in advance, a has taken care that the world we live in appears to be a sensible one, is – at least – internally consistent.

So is a universe where we do have choice, but the choices are just random events. That’s not enough to constitute what we would normally call ‘free will’, but maybe that’s just how it is. There needn’t be a free will just because we think it’s nice if there is.

A universe with real choices, either chosen by our nonmaterial spirit, or a god, needs to explain how this nonmaterial thing interacts with matter ‘on the go’ – i.e. not from the start of the universe, but to allow for real choices once the material conditions are given. What we know of physics doesn’t offer any real possibilities here – but our knowledge of physics might be incomplete here.

And the question could be wrong because the concept of ‘free will’ is not consistent – but why would it, and how could we decide which concepts are consistent and which ones not?

Posted in philosophy | Comments Off on 3D Printing Myself – or: Do we have a Free Will?

Code Generation Strategies for ART DECOR

Last time I wrote about code generation using ART DECOR. This time we’ll look a some more code generation, and then consider various strategies for code generation.

In the previous post we saw how to generate HTML for a user interface for a transaction in ART DECOR. We can do the same for database code.




Like in the HTML generation, the XSLT used to generate the code operates on the output of RetrieveTransaction, and is rather small itself. And, like before, this is not a complete code generator yet: not all datatypes are included etc., so only use this as the start for your own code generators. This generated SQL (tested on PostgreSQL) implements the following database model:

 ada-codegen-dbEach concept group becomes a table, value sets (vs-measured-by) get their own table, which is populated by the rows in the value set.


If we hook up some middleware, which can be pretty generic, the middleware, the HTML UI and the database would be a complete application.

Some caveats for real-world usage:

  1. It’s probably better to derive the SQL datatypes from the HL7v3 datatypes in RetrieveTransaction (only possible when HL7v3 is the target, and specs are complete). For more information on generating SQL from HL7v3 datatypes, see RIMBAA_MGRID_HL7v3_Datatypes.pdf for a thorough approach.
  2. Value sets here get their own table. Another approach is to have one table for all value sets, with extra columns for value set name or id. Take care: the approach I’ve chosen uses artificial primary keys in de value set table (with values 1, 2, 3…). This works well for a single version, but what’s constant over several versions of a message is the combination of code and codeSystem. So if you follow my approach, make sure to keep the primary keys constant over time.
  3. I simply generated a separate table for each concept group. It’s easy to improve over that approach: groups which are 0..1 or 1..1 do not need their own table. Basically, the generated database is split in more tables than necessary.

The next question is what the best strategies for code generation along the lines I’ve sketched are. Of course it’s possible to generate an entire application, but that would be suboptimal. ART DECOR (usually, not necessarily) models interchange, so messaging between applications, and not static information models. The requirements for a database are as a rule not covered by interchange models. So while this approach is possible, it would probably need an augmented underlying model.

A better approach is to use code generation as a messaging layer between your own application and the outside world. Parse incoming messages and store them in temporary tables. RetrieveTransaction already contains XPath expressions which point to the right locations in the incoming XML (not 100% complete though, so use as a starting point). Then populate your own DB from the temporary tables, and empty the latter.


This is a very flexible model: when there is a new version of the messaging standard, simply re-generate the insulating layer with generated tables. This will enable you to read new messages without too much ado. The conversion to the proprietary DB will need some updating, of course: there is a new version of the message, so things will have changed. Still, the prorietary DB will be insulated from many changes to the messaging format itself, and the logic which needs updating will be minimized.

Another strategy is to use code generation to generate form parts which do not have corresponding fields in your own database. Such a strategy would involve:

  • generate an HTML form from RetrieveTransaction;
  • prepopulate the form with all the data which already is in your own database;
  • present the form to the user (embedded within your own application);
  • have the user complete the information which is not in your database;
  • generate a message, and send it.

This strategy corresponds well to cases where for instance generic patient data are already in your database, but additional information is needed for some report which needs to be sent. Again, if a new version of the report and message is coming along, this approach ensures only minimal changes to the underlying logic.

Code generation is already used in many projects in the Netherlands, both to generate UI and database logic, as well as for data extraction. All in all, ART DECOR provides all the tools needed to leverage your applications with code generation, and thus implement exchanges in a quick and robust fashion.

Posted in artdecor | Comments Off on Code Generation Strategies for ART DECOR

Mijn medisch dossier is van mij! Of toch niet?

Je hoort het met enige regelmaat. “Het is eigenlijk heel simpel: het dossier van een patiënt is eigendom van die patiënt! En niet van anderen, zoals de zorgverlener.” Maar zo eenvoudig is het niet.

Om te beginnen bestaat er in Nederland geen “eigendom” van intellectuele gegevens. Op het fysieke dossier kan wel eigendomsrecht rusten, maar in deze tijd van digitale dossiers is dat vrij betekenisloos geworden. Een digitaal dossier is dus niemands juridische eigendom. (Zie ook: ‘Van wie is het dossier’, Anton Ekker, Nictiz 2010.) Er is hoogstens sprake van auteursrecht, maar daarop wordt bij medische dossiers zelden of nooit een beroep gedaan. Prima, zal de tegenwerping zijn, misschien klopt dat in technische zin wel, maar dat is juridische haarkloverij. Moreel gezien is er maar één iemand eigenaar van het dossier, en dat is de patiënt! Maar nee, ook dat klopt niet.

Neem een simpel voorbeeld. Mijn arts schrijft mij een recept uit voor 30 keer 75 mg Nortrilen. Dat recept maakt deel uit van mijn medisch dossier. Maar mag ik nu naar eigen inzicht dat recept wijzigen, en die 30 veranderen in 300? De Wet op de Geneesmiddelenvoorziening stelt dat een recept door een arts ondertekend moet zijn. Wat ik dus ook zelf aanpas in een dossier, een recept is het daarna niet meer. Zo zal een arts ook niet willen dat ik in “mijn” dossier de diagnose obstipatie aanpas wanneer ik vermoed dat er toch wel wat ernstigers dan dat aan de hand zal zijn. (Wanneer een patiënt het niet eens is met een diagnose, heeft deze wel het recht een eigen verklaring aan het dossier toe te laten voegen.) En wanneer ik een bloedwaarde in een laboratoriumuitslag aanpas, is dat geen laboratoriumuitslag meer, maar gewoon een kladje waarin ik zelf wat gerommeld heb. Wat is dat nog voor “eigenaarschap”, wanneer ik de gegevens niet aan mag passen?

Zelfs het (laten) verwijderen van gegevens uit mijn dossier mag niet altijd. Meestal heb ik dat recht wel, maar niet als een aanmerkelijk belang van een derde zich daartegen verzet. Zo’n  belang kan bijvoorbeeld de arts zelf hebben. Wanneer ik een klacht over de arts indien bij een tuchtcollege, kan de arts zijn dossier nodig hebben om zich te verdedigen, en hoeft het zolang de zaak loopt, niet te vernietigen wanneer ik daarom vraag.

Kortom, ik heb het recht niet “mijn” dossier naar eigen inzicht te wijzigen, en onder omstandigheden kan ik het zelfs niet verwijderen. Wat voor een eigendom is dat? De feitelijke situatie is natuurlijk anders. Juridisch is er geen sprake van eigendomsrechten, en in lossere zin is het eigendom gedeeld:  de zorgverlener heeft het deels geschreven, en de medische inhoud is de verantwoordelijkheid van de zorgverlener.

Uiteraard kan ik prima spreken over “mijn medisch dossier”, maar dan in de zin van “over mij”, niet “van mij”. De essentie van “mijn dossier” is dan ook ten eerste dat ik mag bepalen wat ermee gebeurt: wie het in mag zien, wat er uit verwijderd wordt (met een klein voorbehoud om anderen te beschermen), en uiteraard: dat ik er zelf bij mag! Niet een beetje, niet een deel, maar helemaal. Dat is in Nederland in de praktijk nog niet altijd goed geregeld. Daarover een andere keer meer.

Posted in EPD, zorg | Comments Off on Mijn medisch dossier is van mij! Of toch niet?

Using ART DECOR for Code Generation

ART DECOR is a framework for capturing medical information requirements, mostly for the exchange of data in healthcare. In a short series of articles we will explore the benefits ART DECOR offers for implementers. (See the ART DECOR Factsheet for a short general introduction, or for detailed documentation on ART DECOR.) ART DECOR captures the data needs of healthcare professionals and patients in datasets and scenarios. ART DECOR does not only help healthcare professionals and IT architects to model medical data, it also offers a wealth of goodies for implementers, some easier to find than others.

Take a look at one of our demos, Measurements by Patient. This page, the ProjectIndex gives access to most resources available for developers. Look for instance at the Vital Sign Result valueset from the Vital Signs Demo. It’s also available in XML and CSV, for easier importing into an application. But let’s look further, to the main transaction from the first demo, the Measurement Message. Most of the data needed for an application is in there: field names, data types, code lists, cardinality, help text (description). This data is also available as XML, and this is an ideal hook for code generation. This XML version of RetrieveTransaction contains even more in the <implementation> element, which contains an XML- or SQL-friendly name (shortName), as well as the HL7 datatype. RetrieveTransaction gathers all data from the dataset, transaction and valueSets, and combines those into a single view.


There’s also detailed documentation for RetrieveTransaction. RetrieveTransaction thus contains almost everything that’s needed for code generation. In the example below, I’ve made a basic HTML code generator. This is just an example, if you wish to use is for real code generation, you will need to adapt it – only some datatypes are supported, the submit action doesn’t actually do anything etc. Later we’ll look at a more full-fledged code generator.


What is done here is just a simple XSL conversion from the RetrieveTransaction output to a HTML page. The XML tab contains the RetrieveTransaction output, the XSL tab the stylesheet which is the actual code generator, and the HTML tab the generated code. The Result tab shows the rendered HTML (it is a .png, since the HTML doesn’t render well in WordPress – here is the HTML Result page as HTML).






As you can see, the actual XSLT to generate the HTML code is pretty small. A real HTML generator would need some more, but still needn’t be large. For a larger example, here is the generated HTML for the epSOS Patient Summary (due to IP issues, some Snomed codes are not included, so corresponding drop-downs will be empty).

In the second installment of this short series, we’ll take a further look at strategies for code generation with ART DECOR.

Posted in artdecor | Comments Off on Using ART DECOR for Code Generation

Handreiking OID systematiek instellingen

Inrichten van een OID register kan voor instellingen een opgave zijn. Deze handreiking is geschreven in opdracht van het BovenIJ ziekenhuis, een geeft een mogelijke aanpak.
OID systematiek instellingen.pdf
Let wel: de beschreven aanpak is maar een van vele mogelijkheden.

Posted in hl7 | Comments Off on Handreiking OID systematiek instellingen

XML Amsterdam 2013

Spoke yesterday at XML Amsterdam 2013 on ART DECOR, an open source framework for medical metadata. Slides available.

Posted in artdecor, hl7, semantics, xml, zorg | Comments Off on XML Amsterdam 2013

Over oneisen en nonwensen

En nog een column in Computable, ‘Over oneisen en nonwensen‘.

Posted in ICT | Comments Off on Over oneisen en nonwensen