Archivi autore: Pierfrancesco Ghedini

Le sfide della nuova generazione di sistemi informativi sanitari, puntata #2

Se dovessi sintetizzarla in una frase soltanto direi: “Tutti gli stackeholders autorizzati debbono poter avere garantito l’accesso ai dati sanitari, sempre e da dovunque.”

Sembra semplice, ma non lo è o, quantomeno, non lo è stato fino ad ora. D’ora in avanti dovrà esserlo.

I sistemi sanitari che trattano i dati del paziente per fini di cura debbono garantire l’accesso alle informazioni a tutti i portatori di interesse, attuali e futuri, che intervengono nel processo di cura.

Qualcuno potrà subito commentare che l’affermazione è ovvia, ma la parola chiave è nell’aggettivo “TUTTI”:

  • Il paziente è un portatore di interesse…
  • I parenti autorizzati dal paziente, sono portatori di interesse…
  • I sanitari che intervengono nel processo di cura, sono portatori di interesse…
  • Gli eventuali consulenti che vengono coinvolti dal paziente per una valutazione di “Second Opinion”, sono portatori di interesse…
  • I ricercatori degli IRCSS che debbano accedere per fini di ricerche autorizzate ai dati del paziente, sono portatori di interesse…
  • La comunità scientifica a cui il paziente in veste di “data donor” abbia donato i dati, sono portatori di interesse…
  • ecc…

E questo deve avvenire in tempi e modi tali da non inficiare il valore di quel patrimonio prezioso che sono i dati di salute del paziente: occorre, al contempo, garantire un efficace percorso di salute, ma anche il rispetto dei diritti fondamentali dell’interessato, anche ai sensi della vigente normativa sulla tutela dei dati personali.

Qualcosa di tutto ciò di certo già facciamo negli attuali sistemi informativi sanitari, ma di certo i nostri attuali sistemi non sono ancora pensati per garantire accesso a tutti gli stackeholders… e, di certo, NON da dovunque.

Quello dell’accessibilità del dato sanitario al di fuori delle canoniche mura dell’azienda sanitaria è un problema che è esploso durante il periodo pandemico, quando i sanitari si trovavano ad operare in luoghi diversi dalla loro sede abituale, ma è destinato a rimanere come esigenza strutturale dei sistemi informativi sanitari di nuova generazione. La cosiddetta “virtualizzazione della sede fisica di lavoro” pone diversi problemi alla attuale generazione di sistemi sanitari, problemi che debbono essere superati in una ottica di evoluzione strutturale dei sistemi. Non siamo, infatti, chiamati ad esporre una singola funzionalità applicativa, ma tutte le funzionalità che permettono di gestire l’intero percorso di cura. Garantire ciò e farlo in sicurezza, sono obiettivi imprescindibili per i sistemi della prossima generazione.

Il terzo e ultimo problema, l’accessibilità dei sistemi informativi sanitari 365 giorni all’anno, 24 ore su 24, è stato tenacemente perseguito nei sistemi sanitari tradizionali e potrebbe essere considerato un obiettivo scontato anche per la prossima generazione di sistemi informativi.

Vale, tuttavia, la pena di considerare che questo obiettivo non è indipendente dai due precedentemente enunciati. In altre parole, dire che le informazioni sanitarie debbono essere accessibili da tutti gli stakeholders, da dovunque e con alti livelli di continuità di servizio significa imporre l’adozione di infrastrutture CLOUD ad alto o altissimo livello di resilienza al guasto e alto o altissimo livello di sicurezza, cosa che poi non è così scontata e semplice da realizzare e da manutenere.

In altre parole: vogliamo che sia facile accedere ai dati sanitari quanto accedere ad una ricerca in GOOGLE, ma che ciò sia sicuro quanto l’accesso all’oro di Fort KNOX.

Semplice, no?

Idee per “Next Generation Healthcare Information Systems“. Questo articolo fa parte di una serie il cui primo è reperibile a questo Link

Pierfrancesco Ghedini

Licenza Creative Commons
Quest’opera è distribuita con Licenza Creative Commons Attribuzione 3.0 Italia.

Le sfide della nuova generazione di sistemi informativi sanitari

AI and Healthcare

Pixabay source: Pixabay (Creative Common free for use

Un direttore di unità operativa, uno di quelli che hanno passato la propria vita a curare i pazienti e che ancora pensano che sia giusto e doveroso farlo, un po’ di tempo fa mi diceva: “Vorrei avere più tempo… queste fantastiche diavolerie che mi proponete, mi fanno perdere tempo. Io devo stare al letto dei pazienti.”

Avrei voluto dirgli che si sbagliava, che quelle “diavolerie” non erano certo la ragione per cui aveva meno tempo per i suoi pazienti…  Purtroppo, so bene che ha ragione.

Il problema più rilevante che oggi ci troviamo ad affrontare è che abbiamo raggiunto il limite di informazione gestibile per singolo paziente da parte del singolo operatore. E non è un problema di quanti click richiede la singola applicazione, il problema è più drammatico.

Quando l’informazione a disposizione è superiore alla capacità di gestione del percettore, tutto rischia di diventare rumore e la reale utilità della comunicazione scema fino a rasentare l’inutilità.

È un fenomeno che gli informatici e gli esperti di teoria delle comunicazioni conoscono bene: quando il rumore sovrasta il segnale, il segnale diventa non più trattabile per il ricevente. Non si riesce più a estrarre il segnale utile dal CAOS del rumore casuale.

Ma fra la messe infinita di informazioni che oggi si generano durante un episodio di cura (sia esso un accesso di minore entità quale un accesso ambulatoriale o un episodio di cura di maggiore peso, quale ad esempio un ricovero in acuzie), quale è l’informazione da enfatizzare e quale è il rumore da limitare, perché non nasconda il senso di ciò di cui il sanitario abbisogna per poter correttamente interpretare il quadro clinico?

Ho l’impressione che siamo di fronte a sfide inedite: temo che non possiamo più limitarci a dire che i sistemi che implementiamo debbono essere usabili e completi di tutte le informazioni disponibili, questo è ormai scontato, anche se non semplice da garantire… Ciò che mettiamo a disposizione deve anche essere “utile”.

Ciò significa che: pur non avendo ancora vinto la sfida delle doppie imputazioni di dati – a causa della scarsa o inesistente cooperazione applicativa che riusciamo a garantire -, pur non riuscendo ancora a garantire una adeguata usabilità applicativa – a causa di una scarsa ergonomia degli strumenti che ancora appartengono ad ere tecnologiche precedenti l’attuale -, siamo già costretti a combattere la battaglia delle significativa delle informazioni. Non riusciamo a far galleggiare l’informazione utile sul mare dei dati inutili, tutto è indistinto, parte del CAOS randomico di troppe informazioni scarsamente rilevanti.

Quali siano i dati “utili” rispetto al rumore, lo dovremo di certo definire sul campo, aiutati dalle tecniche che stanno prepotentemente emergendo grazie all’egregio lavoro che stanno facendo i “Data Scientists” che mettono a punto ogni giorno armi affilate per sfidare il CAOS.

Se dovessimo definire una priorità in base alla quale modellare il progetto dei sistemi informativi della prossima generazione, questa debba essere la priorità principale: creare sistemi completi ed usabili, ma che siano focalizzati sui bisogni dei singoli professionisti, quindi meno “time consuming” di quelli attuali.

Penso che ricontatterò il mio amico medico e gli dirò: “Parliamone, è ora di trovare una qualche soluzione…

Idee per “Next Generation Healthcare Information Systems“.

Pierfrancesco Ghedini

Licenza Creative Commons
Quest’opera è distribuita con Licenza Creative Commons Attribuzione 3.0 Italia.

FHIR client CRUDS

FHIR Release 3

FHIR Release 3

In this notebook you can find some snippets of code  about accessing a FHIR server for Create, Read, Update, Delete, Search FHIR resources… by means of a FHIR python client.

The FHIR python client used is the “SMART-ON_FHIR/client-py”, more info about it here.

The FHIR python client module is easily installed by issuing the command:

pip3 install fhirclient

 

FHIRClient CRUDS

Enjoy and let me know if you like it in twitter @pierfghedini.

Pierfrancesco Ghedini

Licenza Creative Commons
Quest’opera è distribuita con Licenza Creative Commons Attribuzione 3.0 Italia.

Machine Learning development platform

To dig a mine you need suitable tools, you cannot dig with your bare hands

To experiment with Machine Learning techniques, you need a suitable platform with all the necessary tools configured and working or you’ll waste your time in trying to set up the tools instead of solving your problem.

In this Jupyter Python Notebook you can find a simple tutorial that will instruct you to set up a suitable platform to work in and an example of use.

The example is the already classic analysis of Titanic shipwreck, we will use the well known RandomForestClassifier to predict the shipwreck survivors.

Download the tutorial at:

https://github.com/pghedini/MLPlatform

Enjoy and let me know if you like it in twitter @pierfghedini.

Pierfrancesco Ghedini

Licenza Creative Commons
Quest’opera è distribuita con Licenza Creative Commons Attribuzione 3.0 Italia.

Digging Twitter Users with Python

Digging Twitter Users with Python

Digging Twitter Users with Python

Tanks to the powerful Twitter REST API, it is easy with few lines of python code to extract useful information from the Twitter Engine.

The tool is written in python – it works in Python 2.7 and Python 3 – and it is quite handy to dig Twitter users, in particular it deals with Followers and Friends of a Twitter Account. You can download the code from https://github.com/pghedini/twitter_users

Features

The tool, by means of Twitter REST API, gets Followers and Friends of a given user. it provides the New followers and the Lost followers since the previous run.

It gives also the Not Following Friends: the Friends not following the given user.

Tot: 520 follower.
New follower: 10
Lost follower: 1
Unchanged follower: 509

Tot: 795 friends.
Friends not following: 355

In verbose mode, the tool gives the lists of New Followers, of Lost Followers and Not Following Friends.

Conclusion

The code is straightforward and you will be able to modify it to custom its features.

Enjoy and let me know if you like it in twitter @pierfghedini.

Pierfrancesco Ghedini

Licenza Creative Commons
Quest’opera è distribuita con Licenza Creative Commons Attribuzione 3.0 Italia.

Health Information Technology Cybersecurity – the architecture

The cybersecurity of health information systems is a complex issue that requires a systematic approach. 

In this article we will analyze a proposed cybersecurity architecture for a generic Healthcare Authority. Here, Healthcare Authority means a generic Healthcare Organization that deals with primary care, or secondary care, but also home care and community care….

The proposed architecture is designed to fit a University hospital, as well as a country hospital, as well as a local Healthcare  Authority with medical outpatients clinics…

We will indicate the generic Healthcare Authority with the acronym HA.

Architecture schema

Health Systems Cybersecurity Schema

Health Systems Cybersecurity Schema

The  roles

All users can be modeled in only three main roles:

  1. the guests – not authenticated users -;
  2. the professionals – authenticated users who use systems from inside and outside the HA -;
  3. IOTs and other automated systems that needs an interaction with the HA. 

The double role of IoT and IoMT

The IoTs – Internet of Things – and the IoMTs – Internet of Medical Things – devices  comprehend also medical devices that operate outside the HA. 

For simplicity we will map IoTs to unauthenticated users – guests role – if they do not need an access to HA systems – they do not need access to applicative functions -. We will map IoTs to professionals role, if they need access to applicative functions. 

The cyber-security architecture 

The HA infrastructure is segmented in four zones:

  • the sandbox zone;
  • the exposed systems zone;
  • the untrusted systems zone;
  • the isolated systems zone.

The sandbox zone is the only zone the guest can access to. From the sandbox zone is not possible to access other zones. 

Vice versa from other zones you can access the sandbox zone.

In the sandbox zone there is a restricted access area to which only authenticated users can access to. The datas in this area are crypted and they are accessible also offline. This sandboxes zone can be located on a portable devices in order to make sensitive data available when the used devices are offline. 

The exposed system zone is the area where are located the hardenized systems which are accessible by authenticated users, from outside or inside of the HA. The systems in the exposed zone are the only way to reach the systems in the isolated zone or in the untrusted zone. 

The isolated zone and the untrusted systems zone are accessible only by authenticated users who have application grants on servers of the exposed zone. Typically in the isolated zone you can find the most sensitive systems and the DB resources. The isolated zone in segmented by sensitivity or level of trust. 

The untrusted zone is typical of the healthcare domain and contains the Medical Devices and other systems which cannot be considered hardenized to handle a direct access in the exposed zone. Typically, these systems need a network protection. For the same reasons the most sensitive systems are collocated in the isolated zone.

As the exposed zone, the untrusted zone is logically unique, but physically represents a myriad of connected network areas that include only a few or only one equipment.

Test systems and Maintenance activity

In HA, the maintenance activity is often guaranteed by outside partners. These partners must have access to the systems they manage, but only those. In addition, all their activities must be network logged, because HA cannot trust system logging due to the fact that these partners often have administrative rights over the systems they manage. 

Another important issue is the HA need of a test area, or “staging” area, in each zone.

In the test area of each zone there are test systems or pre-production systems. The systems in the test areas cannot access to production systems. The test systems in each zone has the same security restriction and possibilities of analogous production systems. In other words, the test area is specular to the production area, but completely separated.

GDPR orchestration

HA must orchestrate the entire security architecture according the GDPR – GDPR, General Data Protection Regulation, UE 2016/679 – policy and rules. In fact, the GDPR imposes the definition of the security policies the administration has decided to undergo and the periodic verification of the respect of these policies. 

Use case

Access to inpatient datas: in the morning, Doctor Alice orders an entire suite of blood exams for inpatient Bob. Later, in the afternoon, doctor Alice is notified the Bob’s results are ready and Alice access to the the results from her home. 

When Alice is at work, in the morning, she uses a ward mobile device to order the exams, then uses a POCT – point of care testing – analyzer located in the ward the analyze the Bob’s blood. She takes a look at the values the analyzer gives directly, but she needs the pathology department validation. She receives notification a validation is ready when is at home, in the late afternoon. She receives a SMS that says new pathology results are ready – no sensitive data are sent in the SMS -. Alice take a look at the results with her home computer.

From a security perspective several systems in different zones are involved in the process:

A) in the morning, Alice accesses the Order System that is in the Exposed Systems Zone;

B) the analyzer Alice uses is located in the Untrusted Systems Zone;

C) the Bob’s exams results are collected by the Pathology System which is located in the Exposed Systems Zone;

D) from her home, Alice get accesses to the Clinical Data Repository System in order to get the Pathology report; the Clinical Data Repository is in the Exposed Systems Zone. The DB of the Data Repository is in the Isolated Systems Zone.

Key points

  • It doesn’t matter if Alice is at work or at home, she uses the same systems; in other words the systems, in exposed zone, are hardenized to be exposed in internet, even if they are only used from inside HA;
  • the medical device, the POCT, is considered untrusted, by virtu of this the network makes port filtering, web firewalling and so on… the device is isolated in the Untrusted Systems Zone and it can not be directly accessed;
  • sensitive resources are isolated in Isolated Systems Zone and can not be directly accessed;
  • Guests interact with HA safely through a Sandbox Zone.

Conclusion

Security architecture is not the solution. In order to achieve a sufficient level of cybersecurity you have to adopt a conspicuous number of different techniques, but without a security architecture it’s difficult to reach the goal. 

Pierfrancesco Ghedini

Licenza Creative Commons
Quest’opera è distribuita con Licenza Creative Commons Attribuzione 3.0 Italia.

FHIR CLI updated to 1.4.0

FHIR_3

Now FHIR CLI is STU 3 compliant. The easy to use Command Line Interface to HL7 FHIR® – Fast Healthcare Interoperability Resources (hl7.org/fhir) – now supports also the latest version of the standard.

In order to use it,  download the libraries from GITHUB: https://github.com/pghedini/fhir-cli and follow the instructions to use the STU 3 compliant client.

Let’s see an example session:

# Import the version STU 3 Candidate compliant
In [1]: from client_v3 import *

In [2]: cli = init_client()
Using FHIR Server: http://fhir3.healthintersections.com.au/open/
Verbosity LOW
No logging file.
No console logging.

# let's see the supported resources

In [3]: RESOURCES

In [3]: RESOURCES
Out[3]: 
[u'Account',
 u'AllergyIntolerance',
 u'Appointment',
 u'AppointmentResponse',
 u'AuditEvent',
 u'Basic',
 u'Binary',
 u'BodySite',
 u'Bundle',
 ...
 u'Patient',
 ...]

# and how much are they
In [4]: len(RESOURCES)
Out[4]: 114

# or make a query
resp = read(cli, "Patient/example")
# ...

HL7® and FHIR® are registered terms of the subject having right (HL7 organization).

Pierfrancesco Ghedini

Licenza Creative Commons
Quest’opera è distribuita con Licenza Creative Commons Attribuzione 3.0 Italia.

Sul dare fiducia – Trusting Trust –

Ken_Thompson

Ken Thompson

In un mio articolo pubblicato sul numero 3 della rivista “Reputation Today” trattavo del dibattuto tema della catena di fiducia che si deve instaurare fra fornitore e committente al fine di garantire la sicurezza di una qualsiasi installazione informatica. Per chiarire il concetto citavo un famoso attacco informatico ideato da Kenneth Thompson, il “Trusting Trust Attack“.

Il primo a parlare di questo attacco fu lo stesso Thompson, in occasione del discorso che tenne,  nel  lontano 1983, quando ricevette il Turing Award, uno dei più ambiti premi nella comunità informatica. Da tempo girava voce che Ken, che era uno degli inventori dello Unix, uno dei più diffusi sistemi operativi per computer, potesse entrare in qualsiasi sistema a dispetto del fatto che non possedesse le credenziali di accesso. Per verificare ciò erano state messe in atto analisi anche molto approfondite, ma non si era approdati a nulla e Thompson continuava a sorridere sornione da dietro la sua barba incolta.

Quella sera, nella sala gremita di azzimati professori e di barbuti hacker con camicie a fiori alla moda californiana, Ken spiegò come attraverso un processo di apprendimento progressivo il software potesse inglobare informazioni al proprio interno annegandole in livelli più interni rispetto a quelli che una ordinaria analisi normalmente considera. Le affermazioni di Thompson svelavano, finalmente, come anni di ricerche sul codice sorgente dello Unix non avessero dato esito: semplicemente occorreva andare più a fondo. Ken stava dicendo che il software installato su di una macchina non è semplicemente l’ultimo livello di software installato, ma anche la memoria di tutto quanto si è fatto in precedenza.

Per molti anni da quel lontano ’83, l’attacco di Thompson o “Trusting Trust Attack” sarebbe rimasto senza reali ed effettive contromisure e ancora oggi rappresenta un paradigma concettuale con il quale confrontare la sensatezza dei nostri approcci alla sicurezza informatica.

Ma questi trenta e più anni di storia dell’attacco ci fanno capire che il messaggio di Thompson era forse ancora più sottile: egli ci ha infatti rivelato che il software, come la terra che calpestiamo, ricorda le nostre orme, anche se la pioggia sembra cancellarle. Ogni generazione di software porta con se i lasciti e le tracce di quelle precedenti… Thompson sembra dirci: “Attenzione. Chi è senza memoria è, spesso, anche senza protezione.”

Per una approfondita analisi sul “Trusting Trust Attack” si veda l’articolo “Reflections on Trusting Trust” di Ken Thompson.

Pierfrancesco Ghedini

Licenza Creative Commons
Quest’opera è distribuita con Licenza Creative Commons Attribuzione 3.0 Italia.

HP Prime – The missing command

HP Prime Calculator

HP Prime Calculator

The HP Prime Missing Command

Frequently I must inspect the values that a function takes in a list of points or I have to take some samples of the function in a neighborhood of a point X0.

With HP Prime I can enter the function in “Function App” and plot it. I can also inspect the numerical value it assumes by means of NUM, but it isn’t an easy way to do my job…

So I wrote down some lines of code to make my life easier. I write down – my – missing HP Prime command.

My missing command takes three forms: FORCALC, LISTCALC and FORCALCFORM

FORCALC and LISTCALC use the function stored in F0 function variable. in FORCALCFORM you can enter the function you want to sample directly in an input form.

FORCALC takes three parameters in input:

  • X_FR – X FROM Value; the start value of the interval to sample;
  • X_TO – X TO Value; the end value of the interval to sample;
  • X_STEP – the increment to add at each loop.

Usage: FORCALC(1,5,0.2)

Output: FORCALC samples the function stored in F0 variable from X=1,to X=5, 20 times (0.2 increment at each loop)

Source code:

EXPORT FORCALC(X_FR,X_TO,X_STEP)
BEGIN
LOCAL OUT={};
 FOR X FROM X_FR TO X_TO STEP X_STEP DO
 MSGBOX("X="+X+" F0="+F0(X));
 CONCAT(OUT,F0(X))▶OUT;
 END;
RETURN(OUT);
END;

LISTCALC takes one parameter in input:

  • LL – List of value to test. The list contains the points you want to sample.

Usage: LISTCALC({1.0, 1.5, 10.0})

Output: LISTCALC samples the function stored in F0 variable in tree points 1.0, 1.5, 10.0.

Source code:

EXPORT LISTCALC(LL)
BEGIN
LOCAL OUT={};
 FOR I FROM 1 TO SIZE(LL) DO
 MSGBOX("X="+LL(I)+" F0="+F0(LL(I)));
 CONCAT(OUT,F0(LL(I)))▶OUT;
 END;
RETURN(OUT);
END;

FORCALCFORM combines the two tools in one.

It takes no parameters in input, but it shows an input form:

SchermoPrime

In FN you have to input the function to sample, in X_FR the start value of the interval to sample, in X_TO the end value of the interval to sample, in X_STEP the increment to add at each loop. In POINT_LIST you can enter the list of points to sample. If you insert something different from {} in POINT_LIST, X_FR, X_TO, X_STEP will be ignored.

Source code:

EXPORT FORCALCFORM()
BEGIN
// Pay attention, it overwrites the variable F0
LOCAL OUT={};
LOCAL FN="";
LOCAL X_FR=0;
LOCAL X_TO=0;
LOCAL X_STEP=0;
LOCAL POINT_LIST={};
INPUT({FN,X_FR,X_TO,X_STEP,POINT_LIST});
 FN▶F0;
IF SIZE(POINT_LIST)==0 THEN
 FOR X FROM X_FR TO X_TO STEP X_STEP DO
 MSGBOX("X="+X+" F0="+F0(X));
 CONCAT(OUT,F0(X))▶OUT;
 END;
ELSE
 FOR I FROM 1 TO SIZE(POINT_LIST) DO
 MSGBOX("X="+POINT_LIST(I)+" F0="+F0(POINT_LIST(I)));
 CONCAT(OUT,F0(POINT_LIST(I)))▶OUT;
 END;
END;
RETURN(OUT);
END;

Simple and useful.

Enjoy.

You may find interesting also this post: http://informaticasanitaria.it/2014/12/06/hacking-hp-prime/

Pierfrancesco Ghedini

Licenza Creative Commons
Quest’opera è distribuita con Licenza Creative Commons Attribuzione 3.0 Italia.

FHIR® $everything operator

FHIRIn HL7 FHIR ® is present a useful operator to retrieve all information related to Patients and Encounters.

In order to keep this example simple we will use the FHIR CLI (Command line interface) to build the resources and to interact with the FHIR server.

Use of $everything operator

The $everything operator is used to return all the information related to the resource on which this operation is invoked, Encounter and Patient. The response is a bundle of type “searchset”. At a minimum, the patient/encounter resource itself is returned, along with any other resources that the server has that are related to the patient/encounter, and that are available for the given user. The server also returns whatever resources are needed to support the records – e.g. linked practitioners, medications, locations, organizations etc

Two input parameters are:

  • start_date -> The date range relates to care dates, not record currency dates – e.g. all records relating to care provided in a certain date range. If no start date is provided, all records prior to the end date are in scope.
  • end_date -> The date range relates to care dates, not record currency dates – e.g. all records relating to care provided in a certain date range. If no end date is provided, all records subsequent to the start date are in scope.

Let’s see operator in action

Start FHIR CLI typing in a python interpreter…

from client import *
cli = init_client()

And now, execute the command…

# Basic invocation on a Patient instance
# 
resp = everything(cli, "Patient/example")

If the resource instance “Patient/example” exists will be returned an out put like this:

POST Url: http://fhir3.healthintersections.com.au/open/Patient/example/$everything
Output code: 200

Other possible invocations are:

# Invocation on all Patient resources
# 
resp = everything(cli, "Patient")
# Basic invocation on an Encounter instance 
resp = everything(cli, "Encounter/example")
# Invocation on all Encounter resources
resp = everything(cli, "Encounter")

Pierfrancesco Ghedini

Licenza Creative Commons
Quest’opera è distribuita con Licenza Creative Commons Attribuzione 3.0 Italia.